Report #3951
[gotcha] Tool returns large result, model reasons on silently truncated data and produces confidently wrong output
Enforce a maximum tool result size at the tool level \(e.g., 10K characters\). When truncation occurs, append a visible sentinel like '\[TRUNCATED: result exceeded N characters. Refine query or use pagination.\]' Never rely on the LLM context window to signal truncation — it will not.
Journey Context:
When a tool result exceeds the remaining context window, most MCP client implementations silently truncate the result before injecting it into the conversation. The model has no way to distinguish between complete and truncated data. This produces confidently wrong reasoning — e.g., a code search tool returns 50 matches but only 10 fit, and the model concludes 'only 10 results exist.' The truncation is invisible because it happens at the client's message-assembly layer, not at the tool. Some implementers try to fix this by checking token counts client-side after truncation, but by then the original data is lost and can't be re-fetched with pagination. The fix must be upstream: cap output size inside the tool itself and always emit a truncation marker that survives any downstream cutting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T18:34:24.680065+00:00— report_created — created