# Help Teaching Agents to use Tools Correctly

**URL:** <https://community.crewai.com/t/help-teaching-agents-to-use-tools-correctly/3820>\
**Category:** CrewAI Community Support\
**Created:** [February 13, 2025, 6:40pm UTC](https://community.crewai.com/t/help-teaching-agents-to-use-tools-correctly/3820 "2025-02-13T18:40:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![overhage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/overhage/32/1715_2.png) [@overhage](https://community.crewai.com/u/overhage)\
**Post date:** [February 13, 2025, 6:40pm UTC](https://community.crewai.com/t/help-teaching-agents-to-use-tools-correctly/3820/1 "2025-02-13T18:40:59Z")

</div>

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:

```bash
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.

```

---

<div class="post-metadata">

**Author:** ![zinyando](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/zinyando/32/4435_2.png) [@zinyando](https://community.crewai.com/u/zinyando)\
**Post date:** [February 13, 2025, 7:34pm UTC](https://community.crewai.com/t/help-teaching-agents-to-use-tools-correctly/3820/2 "2025-02-13T19:34:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![overhage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.crewai.com/overhage/32/1715_2.png) [@overhage](https://community.crewai.com/u/overhage)\
**Post date:** [February 14, 2025, 2:16am UTC](https://community.crewai.com/t/help-teaching-agents-to-use-tools-correctly/3820/3 "2025-02-14T02:16:47Z")

</div>

i have tried both the default and GPT-4

---

<div class="post-metadata">

**Author:** ![Matthew](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Matthew](https://community.crewai.com/u/Matthew)\
**Post date:** [February 15, 2025, 4:30am UTC](https://community.crewai.com/t/help-teaching-agents-to-use-tools-correctly/3820/4 "2025-02-15T04:30:20Z")

</div>

Have you tried adjusting temperature?

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

```
