Report #97353
[gotcha] A single MCP tool result can silently overflow the context window
Server-side: truncate, paginate, or summarize results; for Anthropic clients, annotate tools/list entries with \_meta\['anthropic/maxResultSizeChars'\] \(up to 500K\) for tools that legitimately need large output. Client-side: enforce a max tool-result budget before adding to history.
Journey Context:
Unlike built-in shell/grep tools, MCP result paths often pass raw output straight into the LLM context. A database query or page HTML can return 100K\+ characters, blowing past limits and degrading or resetting the session. Truncation is the conservative default, but it hides information; the better long-term pattern is to design tools that return bounded data \(limits, filters\) and only opt large results in via explicit annotations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:58:45.017572+00:00— report_created — created