Report #1455
[gotcha] Large MCP tool responses silently truncated by LLM provider — agent reasons on incomplete data without knowing
Enforce response size limits inside every MCP tool handler. For large outputs, return a summary plus a pagination cursor or a 'read\_more' token. Include a 'truncated: true' flag in structured responses when output exceeds a threshold. Never return raw file contents or unbounded query results directly.
Journey Context:
When an MCP tool returns a massive response—reading a 2000-line file, dumping a database table—the LLM provider silently truncates the context to fit the model's window. There is no error, no warning, and no sentinel value. The agent then reasons on what appears to be complete data but is actually a prefix. This is catastrophically dangerous with structured formats: JSON or XML truncated mid-element parses as invalid or, worse, as a different valid structure. The fix must happen at the tool layer because the LLM layer has no visibility into truncation. Pagination and summary-first responses are the only reliable defense.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-14T22:33:01.328591+00:00— report_created — created