Problem with the ai agent module tools

s soon as I connect a tool to the ai agent module I get this error message I don’t understand where it comes from…

Error in sub-node ‘Google Gemini Chat Model‘

[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-1.0-pro:streamGenerateContent?alt=sse: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties: should be non-empty for OBJECT type
Open node

  • **n8n version:Version 1.71.2
  • **Database (default: SQLite):sqlite
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):default
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):docker
  • **Operating system:ubuntu 20.04

hi @dominic971

This is weird indeed. Can you test this on the npm version of n8n just to try to understand if this is a docker setup issue or not?

Can you also copy the workflow and paste it here so we can check?

thanks!

Hi @dominic971 I had the same problem and I get the solution here Gemini (1.5 Flash latest) not working in Agent

You have to use at least one $fromAI parameter in any place inside your tool.

Best regards,
Jesús

This is a bug. The Gemini chat model node cannot call Google-related tools but works with other ones like Calculator and Wikipedia. The Google tool just needs to be connected to a Gemini agent for the flow to break.

Error in sub-node ‘Google Gemini Chat Model‘

[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties: should be non-empty for OBJECT type

This is a working flow, but connect Google Docs and it will break.

2 Likes

Confirmed, I have the same problem.

  • Works when no Google Sheets connected but fails when connected.
  • Also will fail when I connect an Output Parser

I confirm the same problem.

When n8n team will fix it?

try this

I am also getting the error

[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse: [400 Bad Request] * GenerateContentRequest.tools[0].function_declarations[0].parameters.properties[Tool_Parameters].type: must be specified when not using one_of, any_of or all_of fields * 


The error occurs when using the Google Models. The Model cannot take parameters from AI either using the {{ $fromAI() }} function or magic by the model.

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