Error while using Custom Tools and FileReaderTool with agent

Hello Team,

I was doing analysis with custom tool to read my specific file to extract the data for user query and in that I’m facing issue related to:

  1. File not found with custom tools
  2. Charmap error with FileReaderTool

Here, I’m attaching the code snippet for the same.
So, can you please look into this and guide me so I can resolve the error and complete my analysis.

Thanks in advance !

Any update on the same ?

Is there any update from the team ?
I would be grateful if someone could look into this matter.

The agent seems to be unable to use the tool as intended. Are you sure you gave the correct file path in the Inputs section? Did you specify that the task should be careful in its description?

Yes, I checked the file path and try different format as well to pass, tried by passing whole local path instead of taking in variable, although it is not able to read via agent, but if I’m running the tool directly, it is able to read the excel file.

In here: excel_reader_tool = ExcelReaderTool(external_file_path=…)
Try to don’t provide external_file_path,
just use: excel_reader_tool = ExcelReaderTool()

Yes, without parameter tool is able to read via agent.
Thanks !

And do you have any suggestion for the FileReadTool() ?

can you share you code with with the filereadtool and also the exact error message

This is the code I’m using to read the file using FileReadTool.

Thanks in advance !

You should use the PDF tool for PDFs - PDF RAG Search - CrewAI

And can we use this FileReadTool to read .xlsx and .docs files because I tried to read .docx file as well but it was returning same error ?

have you read our documentation? - https://docs.crewai.com/ ?

Specifically the tools section

I would take some time to have a read through all of the tools

Yes, I went through the documentation but my objective was to ascertain whether there exists a universal tool capable of reading various file types.
But no issues, I’ll check some work around.

Thanks !