Multiple tool calls in a single Gemini Response breaks the agent. #7204
Replies: 3 comments 14 replies
-
We are including the same amount of functions and it would work with any other provider. It seems like a common issue across many apps with Google since they have some strictness with the way function responses are handled. It can’t be reliably reproduced on my end though. Some more insight on this: |
Beta Was this translation helpful? Give feedback.
-
I realized this was reported before and it ended up being the reverse proxy at issue (one-api). If you are using a reverse proxy, I would report it to the relevant project. I still can't reproduce this issue. After doing more research, it seems this error can also be returned by the Google API when the payload starts with an AI message, and I'll investigate that on my end, if I can cause it that way. |
Beta Was this translation helpful? Give feedback.
-
I have a repro! The error seems to occur once i start using two different MCP servers in one message. Example of one MCP server after another:Example when doing it in one step instead of two: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What happened?
I have a bunch of tools defined for my gemini-2.0-flash-exp agent.
When it uses one tool at a time, everything is fine. However once it starts using more than one tool in a single reply, the very next message will fail immediately with an API error:
Googling suggests that the Google API expected the exact number of tool results back in the next request as it requested. Not doing this will lead to this error I think.
Version Information
ddb2141
Steps to Reproduce
What browsers are you seeing the problem on?
Firefox
Relevant log output
Screenshots
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions