Using some AI Models in n8n with the new MCP tools breaks it.
Gemini Error:
Bad request - please check your parameters
[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-lite:generateContent: [400 Bad Request] Invalid JSON payload received. Unknown name “type” at ‘tools[0].function_declarations[47].parameters.properties[0].value.items.properties[3].value’: Proto field is not repeating, cannot start list. [{“@type”:“type.googleapis.com/google.rpc.BadRequest",“fieldViolations”:[{“field”:“tools[0].function_declarations[47].parameters.properties[0].value.items.properties[3].value”,“description”:"Invalid JSON payload received. Unknown name "type" at ‘tools[0].function_declarations[47].parameters.properties[0].value.items.properties[3].value’: Proto field is not repeating, cannot start list.”}]}]
Open AI Error:
Bad request - please check your parameters
Invalid schema for function ‘query’: [{‘type’: ‘array’, ‘items’: {‘anyOf’: [{‘type’: ‘string’}, {‘type’: ‘array’, ‘items’: {‘type’: ‘string’}}]}, ‘minItems’: 1}, {‘type’: ‘string’, ‘enum’: [‘q/asc’, ‘q/desc’]}] is not of type ‘object’, ‘boolean’.