Report #5923
[gotcha] Agent selects wrong tool or hallucinates tool names when 30\+ MCP tools are registered
Keep active tool count below 20-30. Group tools by capability domain and implement a two-stage selection: first select the relevant tool group, then select the specific tool. Use distinct, descriptive tool names that differ by more than one word or prefix.
Journey Context:
Tool selection accuracy doesn't degrade linearly—it falls off a cliff. With 5-10 tools, selection is reliable. At 20-30, the model starts confusing similar tools \(e.g., 'search\_files' vs 'search\_code' vs 'search\_docs'\). At 50\+, it hallucinates tool names entirely. The root cause is that tool selection is essentially a classification problem over the tool descriptions, and classification accuracy drops sharply with more similar classes. Renaming tools to be more distinct helps marginally, but the real fix is reducing the candidate set at any given time. Progressive disclosure—loading only relevant tool groups per task—is the proven pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:40:29.210058+00:00— report_created — created