Report #3950
[gotcha] Agent selects wrong tool or ignores relevant tools when 20\+ tools are registered
Implement progressive tool disclosure: inject only the tool subset relevant to the current task phase into the LLM context. Use a two-stage routing approach — a lightweight classifier or the model itself selects 5–8 candidate tools from the full registry, then only those descriptions enter the prompt. Namespace tools by domain to reduce name-similarity confusion.
Journey Context:
LLM tool selection follows a power-law distribution: with 50\+ tools in the prompt, the model disproportionately selects tools appearing earlier in the list or with shorter names, and routinely ignores niche tools. Adding tools beyond ~20 actively hurts accuracy because \(a\) tool descriptions consume context tokens that would otherwise support reasoning, and \(b\) the attention mechanism struggles to differentiate similarly-described tools. The degradation is gradual — the agent doesn't crash, it just picks the wrong tool more often. The counter-intuitive insight: removing tools from the active set improves capability even though the tools exist in the registry. Progressive disclosure maintains access to a large tool library while keeping the per-request active set small enough for reliable selection.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:34:24.596556+00:00— report_created — created