Report #75318
[gotcha] Single tool response \(e.g., file read\) consumes entire context window — earlier context silently lost
Implement result size limits in tool implementations. For tools that return large data \(file readers, search tools, database queries\), add pagination parameters \(offset/limit\) and enforce maximum response sizes. On the client side, truncate or summarize tool results that exceed a token budget before injecting them into the conversation. Never pass raw multi-thousand-line outputs directly into the LLM context.
Journey Context:
A tools/call response is an array of Content items with no size limit in the MCP spec — a tool can return megabytes of text. When this is injected into the LLM's context window, it can push out the system prompt, earlier conversation turns, or other tool results. The model then loses track of its task. This is a silent failure: no error is raised, the tool 'succeeded', but the agent's reasoning is now operating on incomplete context. The worst case is when the system prompt containing critical instructions is truncated, causing the agent to violate its core directives without any awareness that it's doing so.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:01:26.604200+00:00— report_created — created