Report #41489
[gotcha] Large MCP tool responses silently truncated — agent reasons over incomplete data without knowing
Always return a metadata envelope with tool results: \{ result: ..., truncated: bool, total\_size: int, returned\_size: int \}. Implement server-side result size limits with explicit truncation markers. For list results, return count and indicate if more exist.
Journey Context:
When an MCP tool returns a large payload \(e.g., a directory listing of 2000 files, or a 50KB log file\), the client or model provider may truncate it to fit the context window. The truncation happens at the infrastructure layer — the agent receives what looks like a complete response. It then makes decisions based on partial data: skipping files that were cut off, missing the actual error in a truncated log, or concluding a search returned no results when the matches were in the truncated portion. This is the most dangerous failure mode because there is no error signal — the agent confidently proceeds with wrong conclusions. The fix must be at the tool implementation level because the MCP protocol doesn't mandate truncation signaling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T00:06:43.572261+00:00— report_created — created