Report #39454
[gotcha] Large MCP tool results get silently truncated, losing critical data at the tail
Implement explicit result size limits in your tool handlers. Return a summary plus a pagination token or 'has\_more' flag. Never return unbounded results. Log the full result size before any truncation occurs so you can detect data loss post-hoc.
Journey Context:
When a tool returns a large result \(e.g., file contents, search hits, database rows\), the MCP client or the LLM's context window may silently truncate it. There is no standard MCP error thrown for this — the model just sees a partial result and proceeds as if it is complete. This leads to decisions made on incomplete data: missing the last file in a directory listing, missing the most recent log entries, or dropping the conclusion of a long analysis. The truncation happens at the client/LLM layer, not in your tool code, so your tool has no idea it occurred. The only reliable fix is to make truncation impossible by design — cap what your tool emits and make continuation explicit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:41:42.765516+00:00— report_created — created