N8N - Connecting AI Agent to Google Gemini and MCP Server leads to error

I get this error when i try to connect my AI Agent to Google Gemini and the new Baserow MCP Server in n8n:

[GoogleGenerativeAI Error]: Error fetching from
https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?alt=sse:
[400 Bad Request] Invalid JSON payload received. Unknown name “type” at
‘tools[0].function_declarations[35].parameters.properties[0].value.properties[0].value’:
Proto field is not repeating, cannot start list.
Invalid JSON payload received. Unknown name “type” at
‘tools[0].function_declarations[35].parameters.properties[0].value.properties[1].value’:
Proto field is not repeating, cannot start list.
Invalid JSON payload received.

When I tried to debug this I got into technical issues and I don’t think I have the settings to configure my MCP Server:

This error is not caused by the text content of your prompt that you provided.

The prompt text you wrote (“Please research in our Baserow XXX Content Database…”, “## Inputs”, “## Your Tools”, “## Instructions”, “## Output”) is used by the AI Agent node to understand the task and how to interact with the tools.

The error, however, points to a problem with the technical definition of the tools that the n8n AI Agent node automatically generates and sends to the Google Gemini API. When you add a tool like “# Baserow MCP Server for Database XXX Content” to the AI Agent node in n8n, n8n creates a structured description of the tool’s capabilities (its functions, their parameters, expected data types, etc.) in a specific JSON format that the Gemini API understands for “function calling”.

The error message Invalid JSON payload received. Unknown name "type" at 'tools[0].function_declarations[35].parameters.properties[0].value.properties[0].value': Proto field is not repeating, cannot start list. means that within this automatically generated JSON description of your Baserow tool (specifically, within the 36th function declaration, parameters, properties, and further nested values), there is a problem with how the type field is defined. It suggests that a field expected to be a single value (non-repeating) is being represented in a way that looks like a list or array.

You cannot fix this by changing your prompt text.

To fix this error, you need to look at the configuration of the “Baserow MCP Server for Database XXX Content” tool within the n8n AI Agent node itself.

Here’s generally where you need to investigate in the n8n editor:

  1. Open the AI Agent node: Click on the AI Agent node in your workflow.
  2. Go to the “Tools” section: In the node’s configuration panel, there will be a section where you added and configured your tools.
  3. Examine the Baserow Tool Configuration: Find the configuration for the “Baserow MCP Server for Database XXX Content” tool. This is where n8n generates the function declarations that are sent to Gemini.
  4. Look at the Operations/Functions: Within the Baserow tool’s configuration, there will be definitions for the different operations it can perform (like “Update row” which you mention in your prompt instructions). These operations are translated into function_declarations for the LLM.
  5. Inspect Parameter Definitions: For the operations that are likely being used (or even just defined, as the error is in the declaration), look at how the parameters for these operations are configured. This is where the JSON schema for the function arguments is built by n8n based on your configuration choices.

What to look for in the Baserow Tool Configuration:

The error path 'tools[0].function_declarations[35].parameters.properties[0].value.properties[0].value' is highly technical and corresponds to a specific nested structure in the JSON sent to Gemini. Without seeing the exact configuration interface for the Baserow tool within the AI Agent node, it’s hard to give precise click-by-click instructions. However, you should be looking for:

  • How are the fields/columns you are interacting with in Baserow (like XXX Posts (******), WP Status (******), etc.) defined as parameters for the tool’s operations (like “Update row”)?
  • Are there options to specify the data type of these parameters?
  • Are there any advanced options for defining the structure of complex parameters or objects being passed to the Baserow operations?

The error suggests that in one of these parameter definitions, likely related to a nested structure within the parameter, the type field is misconfigured in a way that makes it look like a list when it shouldn’t be.

How to potentially fix it (General Guidance):

  • Simplify Parameter Definitions: If possible, try simplifying how the parameters are defined for the Baserow operations within the n8n tool configuration.
  • Verify Data Types: Ensure that the data types configured for the parameters in n8n match what the Baserow operation actually expects and what the Gemini API expects in the function declaration.
  • Look for List/Array Settings: See if there are any checkboxes or settings related to whether a parameter accepts multiple values (a list/array) or a single value. Make sure this is correctly set.
  • Check for Updates: Ensure your n8n instance is up to date, as there might have been bug fixes related to how tool declarations are generated.
  • Reconfigure the Tool: If you’re unable to spot the specific issue, you might consider removing and re-adding the Baserow tool to the AI Agent node to see if a fresh configuration resolves the problem.

In summary: Your prompt text is fine. The error is in the underlying technical configuration of the Baserow tool within the AI Agent node, specifically how its function parameters are defined for the Gemini API. You need to go into the AI Agent node’s tool settings and examine the parameter definitions for your Baserow operations.

I’m receiving the same issue for MCP server on self host but it does work with the hosted version.

I am using the hosted version. I suspect it has something to do with my data structure. I have quite a large database with lots of tables and column types.

I would try a different model like GPT4, I have seen a lot of general issues with Gemini.

Dear @joffcom , when I use any of the GPT models, 4.1, 4.1 nano, 4.0, then I get a different kind of error:

Does anybody has an example and configuration specs where the Baserow MCP Server is working flawlessly?

How many tools are in your workflow?

@joffcom, Its just one tool I am using and its a simple setup, now with OpenAI.

When I try to only use select commands, now I get again a different error when using OpenAI.

I need some proper guidance on how to make his work with N8N,