Report #44211
[gotcha] Large MCP tool results silently overflow context window, causing truncation of earlier critical messages
Implement server-side result size limits \(e.g., 4K characters per text content block\); truncate large outputs with a '\[truncated, N more lines\]' marker; add pagination parameters to list/read tools; summarize or extract relevant sections before returning; client-side, enforce a maximum tool result size and reject or truncate oversized responses.
Journey Context:
The MCP spec places no size limit on tool result content. A read\_file on a large file or list\_directory on a deep tree can return hundreds of KB. When injected into the conversation, this pushes earlier messages — including system instructions, prior tool results the agent was comparing, and the original user request — out of the context window. The LLM then reasons over incomplete context with zero indication that data was lost. The truncation is silent because it happens at the LLM API layer, not at the MCP layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T04:40:45.654767+00:00— report_created — created