[Bug] Gemini model stops after “generating...” when invoking MCP tool

:lady_beetle: MCP Tool Invocation Bug Report

:white_check_mark: Checked the forum

Confirmed that this issue has not been reported yet.


:lady_beetle: Bug Description

Is it possible to get more detailed MCP Server invocation error messages?
When using gemini-2.5-pro-exp-03-25, there are intermittent cases where the LLM announces it is going to call a tool, but no action is taken afterward.


:counterclockwise_arrows_button: Steps to Reproduce

:white_check_mark: Normal Invocation Flow:

  1. LLM decides to call a tool after reasoning
  2. Chat displays “generating…”
  3. [ToolFormer] Creating initial data for MCP is triggered
  4. [MCPHandler] Executing tool ... is triggered
  5. LLM returns the result of the tool call

:cross_mark: Failed Invocation Flow:

  1. LLM decides to call a tool after reasoning
  2. Chat displays “generating…”
  3. LLM stops all activity

:thinking: Preliminary Analysis

In the failure case, the flow proceeds to “generating…”, which suggests that the LLM is preparing the tool parameters. However, [ToolFormer] Creating initial data for MCP is never triggered, which leads me to believe there might be an issue between the LLM’s parameter submission and Cursor’s actual tool invocation.


:magnifying_glass_tilted_left: Additional Info

I am currently developing an MCP Server. Everything works well with other coding agents and other models in Cursor — the issue only occurs when using gemini-2.5-pro-exp-03-25.

  • Request ID: 34bf38b1-e57a-4c94-9b99-5036049c9f94

:laptop: System Info

  • OS: macOS
  • Cursor Version: 0.49.6

:prohibited: Impact

This issue affects the reliability of tool invocation and may hinder development or debugging when using the Gemini model.

1 Like

I can confirm using MCP shrimp task manager that when calling the “split_tasks” tool, the new gemeni has trouble trying to call the tool correctly. But after I asked to learn how it calls other tools, gemeni was able to call it. This means I have to constantly remind llm to learn the tool.

Summary

Version: 0.49.6
VSCode Version: 1.96.2
Commit: 0781e811de386a0c5bcb07ceb259df8ff8246a50
Date: 2025-04-25T04:44:33.500Z
Electron: 34.3.4
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Linux x64 5.14.0-503.38.1.el9_5.x86_64

Hi @deanrie,

Sorry to bother you. Could you please help check if there is anything unusual with this request ID: 34bf38b1-e57a-4c94-9b99-5036049c9f94? This issue only occurs when using gemini-2.5-pro-exp-03-25; other models are working fine. Thank you!

Yes, based on my current testing, the issue mostly happens when Gemini tries to call the split_tasks tool. Unfortunately, I haven’t been able to retrieve detailed error messages from Cursor, so I still can’t pinpoint or fix the root cause.

I’ve tested the same model and task setup using Cline, and it works well there. The problem only occurs specifically when using Gemini inside Cursor.

1ce004cf-40ea-4445-b4bd-d913ea297d45

here some example of failing tool calling

offtopic

btw, great mcp, love it

Hi @deanrie,
Just checking in to see if this issue has been noticed.
Happy to provide any additional details if that would help. Thanks!

Hey, yes. I’ve already created a ticket for this issue, thanks for the report.

1 Like

I can confirm that this was fixed in version 0.50.

Got it — I’ll test it once the 0.50 update rolls out to me.
Thanks for the help!

@deanrie

Thanks for the update.

I received the update notification today and successfully upgraded to version 0.51.
However, the issue still persists.

Because I can’t access detailed MCP invocation logs, I can’t confirm the exact cause.
From my testing:

  • In a new chat session, asking the model to invoke a tool works as expected.
  • But in a longer conversation with multiple turns or a larger context, if I ask it to invoke a tool, it announces the intent to call the tool but then takes no action.

This issue appears only with certain tools. In my case, I’m using the split_tasks tool from the mcp-shrimp-task-manager project.

What I can confirm is:

  • Other models in Cursor perform tool calls normally.
  • The same Gemini model works properly with tool calls in Cline.
  • This issue only occurs with Gemini models in Cursor.

At this point, I’m unsure whether the issue is with the Gemini integration in Cursor, or a compatibility issue with the specific tool.

Thank you for the additional information. We’ll try to sort it out.

1 Like

Hi @deanrie

Based on my continued testing, I found that the issue seems to be related to the JSON format used when calling the tool.

My original format was as follows:

{
  updateMode: '...',
  tasks: [
    {
     name: '....',
     dependencies: ['...', '...'],
     description: '...',
     relatedFiles: [
      {
       path: '...',
       description: '...'
      }
     ]
    }
  ]
}

This kind of nested structure, when used with a sufficiently large context and Gemini, can result in the tool not being invoked at all.

However, after I changed the parameter format to:

{
  updateMode: '...',
  tasks: '[{.....}, {....}]' // 這邊直接改成文字
}

It started working correctly.

2 Likes

Thank you for sharing this solution.