ERROR while using AI-AGENT+GOOGLE GEMINI CHAT MODEL+GOOGLE SHEET

I’m using the Google Gemini Chat Model in n8n and getting the following error:

“Bad request - please check your parameters. Google Gemini requires at least one dynamic parameter when using tools.”

I’ve selected the models/gemini-2.0-flash but didn’t add any additional options. How do I resolve this issue? What dynamic parameters are required?

Any help would be appreciated!

Hello, here is a working example without adding Tool

but in general, this means that you must allow the agent to determine some parameters when using a tool.

If you need further assistance, please share your workflow and the error message so that we can help you more effectively

In my experience, the Google Gemini and N8N Tool Calling Agent is not very stable. I recommend using OpenAI models instead.

Hey @ mohamed3nan,
Thank you for your response, the workflow shared by you above without adding any tools was working fine for me, but after adding Google sheet, it started giving me the error. Still, I wouldn’t be able to solve it.
I’m attaching my full workflow here.

I’m trying to give some numerical table data as input to LLM and want to query those data.

Hey @jakobwowy,
Thanks for you response, Actually the Google one is free to use, so for learning trying out with it.
If you know any other Language model API, which we can use free and are stable with tools and AI agents, it would be very helpful.

Yes, indeed. However, the more you prompt it, the better it becomes. Unfortunately, it is the only free API-based model available.

Hi @Banseedhar

In Google Sheet Tool you have to set the columns and let the model handle it “Defined automatically by the model” like this:

here is a working example:

for better results try Gemini pro, in some cases it is smarter…

1 Like

Hi @mohamed3nan,
Thanks, it’s working fine now, does it require adding all column names explicitly in the sheet parameter setting?

You’re welcome!

I think one is fine—I just tried it, and it was actually able to read all the columns. Just remember to choose a unique column to prevent duplication and confusion.


:point_right: If my reply answers your question, please remember to mark it as a solution.

Let me know if you want any further refinements! :blush:

1 Like

Sure,
All clear, Thanks!

1 Like

Hello, @mohamed3nan
Can I please ask for your help ? I am new to n8n and I want to try to use MCP servers like firecrawl and bravesearch to test how it can improve my work. But I want to try it with Gemini too but I have the same error “Bad request - please check your parameters. Google Gemini requires at least one dynamic parameter when using tools.”

Can you please help me to define dynamic parameter ?

‘<{
“name”: “GeminiFirecrawlTest”,
“nodes”: [
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.chatTrigger”,
“typeVersion”: 1.1,
“position”: [
-680,
1940
],
“id”: “4b77c853-c987-4103-b3cf-31a6b2de50e1”,
“name”: “When chat message received”,
“webhookId”: “35238bfe-f4d0-4680-b660-fd115790c2e2”
},
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 1.8,
“position”: [
-428,
1940
],
“id”: “24bc6b42-7c02-4404-acfb-1351958298f2”,
“name”: “AI Agent3”
},
{
“parameters”: {},
“type”: “n8n-nodes-base.stickyNote”,
“typeVersion”: 1,
“position”: [
-540,
1820
],
“id”: “9af3dd04-c52b-4e8c-ae9c-99b86a668508”,
“name”: “Sticky Note3”
},
{
“parameters”: {},
“type”: “n8n-nodes-mcp.mcpClientTool”,
“typeVersion”: 1,
“position”: [
-340,
2160
],
“id”: “5a053e94-c1a7-4150-b124-24ebd0ae284f”,
“name”: “FirecrawlToolsList”
},
{
“parameters”: {},
“type”: “n8n-nodes-mcp.mcpClientTool”,
“typeVersion”: 1,
“position”: [
-220,
2160
],
“id”: “122d0343-4ca7-4eb6-974e-567aa26d4a1c”,
“name”: “FirecrawlExecuteTool”
},
{
“parameters”: {},
“type”: “@n8n/n8n-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1,
“position”: [
-460,
2160
],
“id”: “3d00fb72-a9cd-42a9-882e-5c39cf280c44”,
“name”: “Google Gemini Chat Model1”,
“credentials”: {
“googlePalmApi”: {
“id”: “fIGvAGEVkdjvcUlR”,
“name”: “Google Gemini(PaLM) Api account”
}
}
}
],
“pinData”: {},
“connections”: {
“When chat message received”: {
“main”: [
[
{
“node”: “AI Agent3”,
“type”: “main”,
“index”: 0
}
]
]
},
“FirecrawlToolsList”: {
“ai_tool”: [
[
{
“node”: “AI Agent3”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“FirecrawlExecuteTool”: {
“ai_tool”: [
[
{
“node”: “AI Agent3”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model1”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent3”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
}
},
“active”: false,
“settings”: {
“executionOrder”: “v1”
},
“versionId”: “19d74925-24d2-40fc-8f4f-e123da11a54f”,
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “08a93a301be51d4821ea58a1647026b5480dcaa43ab9252f6e2e5ca03a6e1668”
},
“id”: “6BYVu01MOTnN2s6j”,
“tags”:
}>’

Tengo el mismo problema, antes quedaba en un bucle de hasta 20-30 interacciones sin respuesta de Google sheets, ahora con la condición $fromAI reconoce la cabeceras de las columnas y realiza una sola interacción, sin embargo, devuelve campos vacíos, no consigue data para mostrar


Hey man , facing the same problem… please help me to fix this.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.