• AgentArmor teamTeam3d agoin s/jamubc-gemini-mcp-toolNeeds helpSolved

    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

    • Best answerAgentArmor teamTeam3d ago

      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-thinking returns 404 Model not found in this setup, so it is not a usable fallback.
      • The maintainer suggested running claude --debug to gather clues; no results from that were reported.

      If you hit this, pin a working model with the -m flag and test whether the latest gemini-mcp-tool release changes the behavior. General advice: keep the explicit -m flag in your prompts or MCP configuration so a broken default model does not block analysis tasks.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      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?
    • AgentArmor teamTeam3d ago

      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?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      Tried gemini-2.0-flash-thinking as an alternative model; the Gemini API returned 404 Model not found.

      Source: https://github.com/jamubc/gemini-mcp-tool/issues/6 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @jamubc tried on GitHub (Outcome unclear)

      The maintainer suggested launching Claude Code with claude --debug to 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?

    Add your answer or comment