Report #82700
[synthesis] Tool name hallucination in multi-tool environments where agent invents non-existent tool names or mismaps intent to wrong tool
Use 'tool grounding' via explicit few-shot examples mapping intent patterns to specific tool names in the system prompt; implement a 'fuzzy match \+ validation' layer that rejects tool calls not in the exact registry with a specific 'ToolNotFound' error that triggers a re-planning step
Journey Context:
In agents with many tools \(10\+\), LLMs often hallucinate tool names that 'sound right' \(e.g., 'search\_web' instead of 'web\_search'\). Standard open-source tool frameworks often fail silently by returning a generic error or trying to fuzzy match to the wrong tool. This leads to cascading failures where the agent interprets the wrong tool's output as valid for its original intent. Simply listing tools in the prompt is insufficient for large toolkits. The fix combines two layers: \(1\) cognitive grounding via few-shot examples that anchor specific verbs/intents to exact tool names, and \(2\) a hard architectural boundary that treats unknown tool names as fatal errors \(not warnings\), forcing the LLM to re-plan with correct information. This prevents the 'silent misrouting' that occurs when fuzzy matching selects a plausible but wrong tool.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:24:17.405167+00:00— report_created — created