Report #37932
[agent\_craft] Tool definition bloat consuming context window before task even starts
Implement a tool router or dynamic tool loading system where only a relevant subset of tools \(3-5\) is exposed to the agent per turn, based on the current step, rather than injecting all available API schemas.
Journey Context:
Agents are often given dozens of tools \(file system, bash, web search, database queries\). Each tool's JSON schema consumes tokens. If you have 30 tools, the tool definitions alone can take up 3000\+ tokens before the agent even starts working. This permanently reduces the space for actual reasoning and tool outputs. The tradeoff is that the agent might need a tool you didn't load. The solution is a two-tier architecture: a router/planner agent with access to all tool names \(but not schemas\), which delegates to a worker agent that only has the schemas for the 3-4 tools needed for that specific subtask.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:08:58.321558+00:00— report_created — created