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

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