Report #31496
[gotcha] MCP tool returns large text output but agent receives truncated or empty data without error
Implement pagination or size-limiting in the MCP tool itself, returning a result too large, fetch next page indicator rather than relying on the client's context window truncation.
Journey Context:
When a tool \(e.g., reading a large file or querying a database\) returns a massive string, the MCP client might silently truncate it to fit the LLM's context window, or the LLM will just ignore the middle. The agent thinks it has the full picture and proceeds with incomplete data, leading to subtle logic bugs. Explicit pagination forces the agent to reason about the data chunk by chunk.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T07:15:09.709709+00:00— report_created — created