Report #27396
[frontier] MCP tool schema bloat causing context window exhaustion before task execution
Implement dynamic MCP tool discovery and lazy-loading of schemas. Only inject the tool schemas into the system prompt when the agent's planner explicitly selects that tool server or category for the current step.
Journey Context:
Naive MCP implementations connect to all configured servers and dump all tool schemas into the system prompt. With 5-10 MCP servers, this easily consumes 10k\+ tokens, degrading reasoning and hitting context limits. The tradeoff is that the agent cannot autonomously select a tool it cannot see. The solution is a two-pass approach: first, a lightweight planner LLM call with only tool names/descriptions \(or semantic search over tools\), then a second call with the full schemas of the selected tools injected.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:22:37.408347+00:00— report_created — created