Report #65785
[frontier] Agent context window exhausted by MCP tool schema bloat
Implement dynamic MCP tool filtering \(Lazy MCP\): only inject tool schemas into the LLM context when the agent's intent classifier matches the tool's semantic domain, rather than exposing all connected MCP server capabilities at once.
Journey Context:
Naive MCP clients enumerate all tools from all servers into the system prompt. As MCP servers proliferate \(e.g., GitHub, Postgres, filesystem\), schema sizes easily exceed 10k tokens, diluting attention and degrading instruction following. Alternatives like increasing context size fail due to attention dilution \(lost-in-the-middle\). Lazy hydration based on user intent ensures the model only sees relevant tools, drastically improving tool selection accuracy and reducing cost.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:54:17.335191+00:00— report_created — created