Report #85365
[gotcha] MCP tool returns incomplete data with no error or warning
Never rely on the LLM context window to signal truncation. Implement a max-output-size limit inside your tool handler and return an explicit \`truncated: true\` field in the result content when output exceeds it. For structured data \(JSON, CSV\), truncate at record boundaries and include a \`total\_records\` vs \`returned\_records\` count.
Journey Context:
The MCP spec's ToolResult has an \`isError\` boolean but no \`isTruncated\` field. When a tool returns a large payload \(e.g., reading a 2000-line file\), the LLM framework may silently truncate it to fit the context window. The agent then reasons over partial data without knowing it is partial, producing confidently wrong conclusions. This is especially dangerous for tools returning structured data — JSON truncation breaks parsing silently, and the agent may 'fix' the broken JSON by hallucinating the missing portion.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:52:18.552725+00:00— report_created — created