Issue with BaseTool Validation Using CrewAI Tools

I’m encountering a BaseTool validation error even when using CrewAI’s built-in tools.

Error:

ValidationError: 1 validation error for Agent
tools
Value error, Invalid tool type: <class ‘crewai_tools.tools.scrape_website_tool.scrape_website_tool.ScrapeWebsiteTool’>. Tool must be an instance of BaseTool or an object with ‘name’, ‘func’, and ‘description’ attributes. [type=value_error, input_value=[ScrapeWebsiteTool(name=‘…secure-Requests’: ‘1’})], input_type=list]
For further information visit Redirecting...

Code snippet where the error occurs:

lead_data_agent = Agent(
config=lead_agents_config[‘lead_data_agent’],
tools=[ScrapeWebsiteTool()],
)

Also, all my earlier agents which worked earlier, started giving this error. is it because of installing/upgrading pydantic or something?

If I had to guess, this might be related to how the tools are being imported.

Check that you import the tools at the top of your crew.py file in the following way:

then instantiate your tools first

Then assign the tools to the agents that you want to use them.

(this assumes agents yaml file is being used, but you should get the idea)

see if that fixes your issue. Good luck.

Thanks! I have done all of this. but the error still persists.

Try changing this to

config=self.agents_config[‘lead_data_agent’],

or post your latest snippet of code and I will be happy to review. I am sure there is just a small issue and you will get it working soon.