Report #4577
[gotcha] Agent runs out of context after only a few turns with many MCP tools registered
Count all tool definition tokens \(name \+ description \+ JSON schema\) against your context budget. Implement tool filtering to expose only the subset of tools relevant to the current task. With 50\+ tools, definitions alone can consume 15-20K input tokens before any conversation occurs.
Journey Context:
Developers assume tool definitions are metadata outside the context window. In reality, every tool's full definition is injected into the API request as input tokens, consuming the same context budget as user messages. This cost scales linearly with tool count and description verbosity. The trap: writing richer descriptions to improve selection accuracy increases the per-tool token cost, creating a vicious cycle. The right fix is fewer visible tools per request, not shorter descriptions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:43:38.911867+00:00— report_created — created