Describe the problem/error/question
The “Tools Agent” node in callin.io does not seem to be working correctly with Gemini models. While it functions as expected with GPT models, when using Gemini, the agent fails to trigger the defined tools. Instead of executing the tool (e.g., sending an email or making an API call), the output shows what looks like the function call itself, such as print(default_api.Enviar_Guia_Disenos(input=True))
.
I also see that in this documentation, there is no mention of Tools Agent being compatible with Gemini Chat Models, but I want to make sure this is not outdated (as I see a lot of content combining Tools Agent + Gemini):
Is there a different way or something to take into account before using Gemini to build Agents?
What is the error message (if any)?
There is no specific error message from n8n. The output of the “Tools Agent” node when using Gemini models is the string representation of what appears to be the intended tool call, rather than the result of the tool execution.
Please share your workflow
Share the output returned by the last node
When using a Gemini model, the “Tools Agent” node outputs a string like:
print(default_api.Enviar_Guia_Disenos(input=True))
Instead of the action defined in the tool “EnviarGuiaDisenos” being executed.
Information on your n8n setup
- n8n version: 1.84.1 (But this is happening with all versions)
- Database (default: SQLite): Postgress
- n8n EXECUTIONS_PROCESS setting (default: own, main): own
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Linux
Please provide the rewritten markdown content *it should be in the markdown format.
You might consider adding more detailed descriptions for your tool calls, explaining how inputs and arguments function, and so on.
This has already been completed, and the agent can successfully invoke tools. However, on occasion, it prints the call directly instead of executing it.
Which specific model are you attempting to utilize? I'm not certain if I noticed.
Please provide the rewritten markdown content *it should be in the markdown format.
Especially with Gemini 2.0 flash.
Thanks
Have you considered beginning with just one or two tool calls and refining their descriptions? This might help identify if the number of tool calls is contributing to any unusual behavior.
Okay, I will check that now…
I've been looking into this, and unfortunately, it's still not resolved.
It seems like there might be an incompatibility issue with Gemini.
Regardless of which Gemini model I select, the problem persists. However, it doesn't occur when I switch to any of OpenAI's models, even their less advanced ones.
I ran into a comparable situation, and by clearly instructing in both the system prompt and user prompt to avoid wrapping any values or tool calls in formatting strings or backticks, I managed to resolve it. I'm not certain if this addresses the exact same problem.
I'm encountering this issue quite often, though not consistently. It appears that at certain points, the AI Agent seems to lose its way and, instead of invoking the tool, it outputs a log of the tool's execution.
I'm unsure of further steps to resolve this problem. I don't know if it's directly related to Gemini, as I haven't used any other models for testing.