Home / Fixes

MCP tool results too large: context window blown by one call

Error: One tool call returns tens of KB (or 1 MB) of text

What causes it

Some read tools return whole documents. In our runs: DeepWiki read_wiki_contents returned about 1 MB for next.js, Microsoft Learn fetch about 47 KB, Exa search about 35 KB for 5 results, Cloudflare Docs search about 28 KB. In batch 2: GitMCP for Next.js returned about 632 KB from one docs fetch, Windsurf Docs about 137 KB and Pinecone Docs about 112 KB from one search, and the Model Context Protocol docs about 182 KB for a nonsense query.

How to fix it

  1. DeepWiki: use read_wiki_structure or ask_wiki_question instead of read_wiki_contents.
  2. Exa: lower numResults.
  3. Microsoft Learn and Cloudflare Docs: search first, then fetch only the page you need.
  4. GitMCP repo endpoints: use the search tools, not the full docs fetch.
  5. Mintlify-hosted docs servers (Pinecone, Windsurf, LangChain and others): keep queries specific, or use the query_docs_filesystem tool to read one page.

Where we hit it

Related fixes

All MCP fixes | Setup guides | Hit a different error? Request a test