Report #1644
[gotcha] Agent uses incomplete data from MCP tool results without detecting silent truncation
Implement size-aware tool results: \(1\) Enforce max output sizes in tool logic and append a truncation marker like '\[TRUNCATED: N more rows\]' when exceeded, \(2\) Use cursor-based pagination for list/query operations, \(3\) After receiving tool results, validate completeness — check for truncation markers, verify expected row counts, validate JSON/CSV is well-formed at the tail. Never assume a tool result is complete.
Journey Context:
MCP tool results have no built-in size limit or truncation signal. A tool returning file contents or database rows can produce output that exceeds the LLM's context window. Truncation happens at the LLM layer — not the MCP layer — so there is no isError flag and no MCP-level indication. The agent receives a partial result and proceeds as if it's complete, leading to silently wrong conclusions. This is especially dangerous with structured data where truncation can produce syntactically valid but semantically incomplete output \(e.g., a JSON array missing its closing bracket, or a CSV with the summary rows cut off\). The agent will confidently reason over partial data with no warning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T06:31:39.087728+00:00— report_created — created