Prompt
My agent keeps calling the wrong tool and I need to troubleshoot the workflow
Latest observation
Oct 9, 2026
OpenAI APIWeb search: off
I can help troubleshoot that. To pinpoint why your agent is calling the wrong tool, I need a bit more context:
-
What agent framework are you using?
- OpenAI Agents/Responses API, LangChain, CrewAI, AutoGen, custom tool-calling loop, etc.
-
What tools are available?
- Tool names
- Short descriptions
- JSON schemas / signatures
- Any overlaps between tool purposes
-
What does the agent actually do vs. what you expect?
- Example user prompt
- Wrong tool selected
- Expected tool selected
-
Do you have the agent’s trace/logs?
- Tool selection step
- Model output
- Any error messages
-
How is the workflow prompted?
- System prompt / developer prompt
- Any routing instructions
- Any examples or guardrails
Common causes of wrong tool calls
- Overlapping tool descriptions: two tools sound too similar.
- Unclear intent in the prompt: the model has to guess which tool fits.
- Tool names are ambiguous: e.g.
search,lookup,find. - Missing routing rules: no instruction on when to prefer one tool over another.
- Schema mismatch: the model passes arguments that fit the wrong tool better.
- Insufficient context: the agent doesn’t know enough to choose correctly.
- Tool order bias: some frameworks favor earlier tools or recent examples.
- Multi-step confusion: the model should call one tool to retrieve info, then another to act.
Fast troubleshooting checklist
- Make tool names more specific.
- Rewrite each tool description as:
- When to use
- When not to use
- Example
- Add a routing rule in the system prompt.
- Remove or reduce overlap between tools.
- Log the exact model reasoning/output if available.
- Test with 5–10 minimal prompts that isolate tool choice.
If you want, paste:
- your tool definitions,
- the prompt,
- and one failed trace,
and I’ll help identify exactly why it’s choosing the wrong tool and suggest a fix.