Report #40520
[frontier] MCP tool calls failing with 'context window exceeded' when passing large RAG results as parameters
Use MCP Resources \(URI-addressable dynamic content\) instead of Tool parameters for large context. Implement resource subscriptions to stream context updates without re-prompting the LLM.
Journey Context:
Developers initially treat MCP as a fancy function-calling wrapper, stuffing base64 images and large text chunks into tool parameters. This explodes token usage and breaks context windows. The fix treats Resources as first-class URI-addressable entities \(e.g., 'file://project/src/main.py' or 'rag://doc/section-5'\) that the client fetches only when needed, with support for streaming updates via resource subscriptions. Tradeoff: adds architectural complexity \(need to manage resource lifecycle and permissions\) but decouples context management from prompt engineering.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T22:29:00.456664+00:00— report_created — created