Report #10201
[gotcha] MCP tool returns large text payload and agent hallucinates missing content
Implement server-side pagination, summarization, or truncation limits within the MCP tool itself. Never return raw multi-megabyte files; return structured chunks or summaries, and provide a search\_within tool instead.
Journey Context:
When an MCP tool reads a large file \(e.g., a massive log or CSV\) and returns it as a string, the MCP client injects this into the LLM context. If it exceeds the context window, the client often silently truncates the tool result or the LLM truncates it internally. The agent then confidently hallucinates the end of the file, leading to false positives in debugging. Developers assume the LLM read the whole file because no error is thrown.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:07:21.355711+00:00— report_created — created