Report #54098
[agent\_craft] Registering hundreds of API tools in the system prompt exhausts context and degrades tool selection accuracy
Dynamically inject tool definitions based on the agent's current sub-task. Use a lightweight router or intent classifier to select only 3-5 relevant tools to expose to the LLM per turn.
Journey Context:
It is tempting to give an agent access to every possible API or bash command it might need. However, LLMs suffer from attention degradation when the tool list is too long; they will hallucinate tool parameters or select the wrong tool entirely. Furthermore, the tool schemas eat into the context window. The solution is a two-tier architecture: a fast, cheap classifier that curates the active toolset, and the actual LLM that executes with a focused context. The tradeoff is an extra routing step, but it dramatically improves tool selection accuracy and saves tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:17:57.599384+00:00— report_created — created