Help Teaching Agents to use Tools Correctly

When one of the agents in my crew attempts to use the PDFsearch tool it generates an error (below) that seems to indicate that the agent is trying to pass the tool a dict rather than an str. I have tried adding explicit instructions to that agent’s backstory but that did not seem to make a difference.

I encountered an error while trying to use the tool. This was the error:

Arguments validation failed: 1 validation error for FixedPDFSearchToolSchema
query
  Input should be a valid string [type=string_type, input_value={'description': 'care act...roidism', 'type': 'str'}, input_type=**dict**]
    For further information visit https://errors.pydantic.dev/2.10/v/string_type.
 Tool Search a PDF's content accepts these inputs: Tool Name: Search a PDF's content
Tool Arguments: {'query': {'description': "Mandatory query you want to use to search the PDF's content", 'type': **'str'**}}
Tool Description: A tool that can be used to semantic search a query the dataset/VADODDyslipidemiaCPG5087212020.pdf PDF's content.

Which model are you using? I have faced such issues when using Ollama based models.

i have tried both the default and GPT-4

Have you tried adjusting temperature?

llm_deepseekr17b = LLM(
    model="ollama/model",
    temperature=0.7,
    num_ctx=8192,
)