Gemini and AI agent tool calling

[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[6].parameters.properties[data].properties[children].items.properties[children].items: missing field. *

Some MCP servers trigger this tool-calling error, but it only seems to occur when using Gemini LLMs. Is there a known workaround (within n8n)?

I have this same issue, still looking for a solution…

Switch to models that are OpenAI compatible with tool calls.
If you are self-hosting, try building a LiteLLM proxy around it

1 Like

Thanks for the response - I need to use Gemini, I don’t have access to other models, and I’m using the cloud service, not self hosted.

I can work around with a subworkflow as a tool or HTTP request and call specific tools that the MCP provides, so I’m not totally blocked, but it’s a lot more leg work and awkwardness.