Describe the problem/error/question
Human: start a crawl on target.com\nAI: Calling MCP_Client with input: {“seedUrls”:“["https://target.com"]”,“tool”:“scan_crawl_start”,“id”:“call_a1bf35ff074bb0f3”}\nTool: [{“response”:[{“type”:“text”,“text”:“Invalid tool arguments: Expected JsonArray, but had JsonLiteral as the serialized body of kotlin.collections.ArrayList at element: $.seedUrls\nJSON input: "[\"https://target.com\"]"”}]}]
I am building a workflow where an n8n AI Agent connects to a local Burp Suite MCP server. I am running into a strict type coercion issue when the Agent tries to pass an array to the MCP Tool.
When the AI Agent uses a tool that requires a JSON array (like passing seedUrls to start a crawl), n8n automatically stringifies the array before passing it to the tool execution.
Expected Payload: {"seedUrls": ["https://target.com"]}
Actual Payload sent by n8n: {"seedUrls": "[\"https://target.com\"]"}
Because the array is wrapped in a string, the strict Kotlin backend of the MCP server rejects it and crashes with an Expected JsonArray, but had JsonLiteral error. Is there a way to force the AI Agent to pass a native JSON array to a tool without n8n aggressively stringifying it?
What is the error message (if any)?
Invalid tool arguments: Expected JsonArray, but had JsonLiteral as the serialized body of kotlin.collections.ArrayList at element: $.seedUrls\nJSON input: “[\“https://target.com\”]”
Please share your workflow
I can't share with you, but i'm using a Chat node connected to an Ai Agent node that has a local AI Agent and a MCP Client Tool connected to it. All of them deployed locally.
Share the output returned by the last node
Calling MCP_Client with input: {“seedUrls”:[“https://target.com”],“tool”:“scan_crawl_start”,“id”:“call_4f17113f00d58536”}
Information on your n8n setup
- n8n version: 2.11.2
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker