Report #16651
[gotcha] Agent consistently calls the wrong tool — descriptions overlap but the LLM can't tell them apart
Make tool names and descriptions maximally distinct. Include example invocations in descriptions. Add negative examples: 'Do NOT use this for X—use tool\_y instead.' Test selection accuracy with a prompt suite before shipping.
Journey Context:
LLMs select tools primarily from the tool name and short description. When two tools have overlapping descriptions \(e.g., 'search\_files: search for files' vs. 'find\_files: find files by name'\), the LLM frequently picks the wrong one. The error response from the wrong tool often doesn't help—it may return empty results, which the LLM interprets as 'no results found' rather than 'wrong tool called.' The agent then reports 'I searched and found nothing' instead of self-correcting. Adding explicit disambiguation text \('search file CONTENTS by regex pattern—use find\_files for filename glob matching'\) dramatically improves selection accuracy. The counter-intuitive part: developers assume the LLM 'understands' the difference because the schema parameters differ, but the LLM makes its initial selection before deeply inspecting parameters.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:14:55.638727+00:00— report_created — created