Report #5922
[gotcha] Large MCP tool responses silently truncated—model reasons over incomplete data without knowing
Implement response size limits in your MCP tool handlers. Truncate or summarize large outputs server-side with a clear indicator \(e.g., '... \[truncated, 847 of 1200 lines omitted\]'\). Return metadata about total result size so the model knows the result is partial and can request more.
Journey Context:
When an MCP tool returns a response that exceeds the remaining context window, the client or model API silently truncates it. Unlike a structured error, the model receives partial data without any signal that it's incomplete. This leads to confidently wrong conclusions—missing records in a query result, incomplete file contents, partial stack traces. The fix must be server-side because the model cannot detect truncation from the truncated output itself. Naive approaches like 'just return less data' fail because the model needs enough data to be useful; the right pattern is structured truncation with explicit continuation markers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:40:29.015043+00:00— report_created — created