MCP tool 'ask-gemini' response exceeds token limit even for small prompts (gemini-2.5-pro)
Using gemini-mcp-tool v1.1.1 with Claude Code on Node v20.19.3, the ask-gemini MCP tool fails with
Error: MCP tool "ask-gemini" response (45735 tokens) exceeds maximum allowed tokens (25000)even for a 10-word prompt like "What is 2+2?". The error only happens with the default gemini-2.5-pro model; gemini-2.5-flash works normally. Does this have a fix or workaround?Originally asked on GitHub: https://github.com/jamubc/gemini-mcp-tool/issues/6
5 answers
Status: still open. No confirmed fix has been reported; the maintainer later said caching should have resolved the problem but needed more testing, and in June 2026 asked reporters to re-check on the latest version (v1.1.7 shipped a test suite and cross-platform fixes) before closing the issue as stale.
The working workaround from the report is to force the flash model explicitly, which returns normal-sized responses:
/gemini-cli:analyze -m gemini-2.5-flash "your prompt here"Key facts from the thread:
- The response is always exactly 45,735 tokens regardless of prompt size, which points to the gemini-2.5-pro model returning a fixed/large response rather than a Claude Code or MCP configuration problem.
gemini-2.0-flash-thinkingreturns404 Model not foundin this setup, so it is not a usable fallback.- The maintainer suggested running
claude --debugto gather clues; no results from that were reported.
If you hit this, pin a working model with the
-mflag and test whether the latest gemini-mcp-tool release changes the behavior. General advice: keep the explicit-mflag in your prompts or MCP configuration so a broken default model does not block analysis tasks.Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Reported the failure with the default gemini-2.5-pro model using
/gemini-cli:analyze "What is 2+2?"; the tool always returned exactly 45,735 tokens regardless of prompt size, causing the 25,000-token limit error in Claude Code.Source: https://github.com/jamubc/gemini-mcp-tool/issues/6 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Worked)
Ran
/gemini-cli:analyze -m gemini-2.5-flash "What is 2+2?"to force the flash model; responses came back at normal sizes and the command worked.Source: https://github.com/jamubc/gemini-mcp-tool/issues/6 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Tried
gemini-2.0-flash-thinkingas an alternative model; the Gemini API returned404 Model not found.Source: https://github.com/jamubc/gemini-mcp-tool/issues/6 (opens external site)
Did this work for you?What @jamubc tried on GitHub (Outcome unclear)
The maintainer suggested launching Claude Code with
claude --debugto see whether debug logs reveal the cause of the oversized response.Source: https://github.com/jamubc/gemini-mcp-tool/issues/6#issuecomment-3066973459 (opens external site)
Did this work for you?
Related questions
- How to fix gemini-mcp-tool ask-gemini timeouts on large codebases?
- How do I fix "Gemini was thinking but got cut off" with gemini-mcp-tool in Claude Code?
- gemini-mcp-tool ask-gemini fails on Windows 11: Error: spawn gemini ENOENT
- How do I set the model for gemini-mcp-tool to gemini-3-pro-preview?
- Windows: gemini-mcp-tool 'Cannot use both a positional prompt and the --prompt flag'