Report #70109
[gotcha] Tool results are silently truncated on context overflow — agent reasons over partial data without knowing
Implement server-side result size limits in every MCP tool. Append a truncation marker \(e.g., '... \[RESULT TRUNCATED: showing first N of M bytes\]'\) to any result exceeding your threshold. For tools returning lists or search results, implement explicit pagination parameters and return result counts so the agent knows when data is incomplete.
Journey Context:
When a tool returns a large result — a file contents read, a database query, a directory listing — and it exceeds the remaining context window, the LLM provider's API silently truncates the message. There is no error, no exception, no indication to the agent that it is working with a subset. The agent then reasons confidently over incomplete data: it misses the bug in the truncated file, concludes a search returned no matches for a pattern that only appears later, or summarizes a document it only saw the first third of. This is one of the most dangerous failure modes because it produces plausible but wrong outputs. The fix must be server-side because the client-side truncation happens after the tool returns, outside the tool's control.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:16:00.874673+00:00— report_created — created