n8n MCP Node - Cannot Connect #1
-
|
Tying to connect to a local mongodb via a local n8n server through a MCP node. Getting the following error: Failed to execute operation: Failed to parse tool parameters: Tool parameters must be a JSON object. Make sure the parameters are valid JSON. JSON: [ any thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The issue comes from your MCP tool configuration. Your {{ $fromAI('Tool_Parameters', `Use tool parameters here`, 'json', null) }}Make sure to pre-prompt your model to follow a Additionally, since Solution: Create two Note: It would have been better if parameters were simply ignored for tools without parameters instead of throwing an error. |
Beta Was this translation helpful? Give feedback.
The issue comes from your MCP tool configuration. Your
Tool_Parametersmust be a valid JSON object, like this:{{ $fromAI('Tool_Parameters', `Use tool parameters here`, 'json', null) }}Make sure to pre-prompt your model to follow a
Record<string, string>format; otherwise, you'll get "invalid schema" errors.Additionally, since
Tool_Parametersis defined this way, even a tool without parameters (e.g.,list-collections) will still include aTool_Parameters: {}ornullkey, which can cause an error.Solution: Create two
executetools – one with parameters and one without – and guide your model to use the appropriate one.Note: It would have been better if parameters were simply ignored for…