Report #103956
[gotcha] A single MCP tool call returns a massive payload and silently corrupts or overflows the context window
Cap tool outputs server-side with pagination, summarization, or head/tail limits plus a \`truncated\` flag. Have the client enforce a \`max\_response\_bytes\` guard before forwarding to the model. For large artifacts, return a resource URI or file pointer instead of inline content.
Journey Context:
Unlike built-in shell output, MCP tool results often bypass host truncation logic. Real cases include a GitHub code-scanning tool returning 145k\+ chars, Claude Code diagnostics returning ~580k tokens, and Copilot CLI silently truncating base64 at 10KB. Because the protocol does not specify response limits, the fix must be bilateral: servers must not emit unbounded data, and clients must refuse to blindly forward oversized payloads to the model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:59:40.607936+00:00— report_created — created