Describe the problem/error/question
I’ve been struggling to pass anything to a MCP server that isn’t anything but a simple string (which is then passed to the tool in the server) as a {placeholder}.
When I pass a string it works fine, but part of the api tool payload is an array of objects, and I can’t seem to figure out how to properly map it in the tool. The input to the tool looks correct actually, perfect, but the server rejects it.
What is the error message (if any)?
Please share your workflow
here is a sample of the API json for the MCP Server HTTP Tool
{
“video_url”: “https://sgp-labs.nyc3.digitaloceanspaces.com/file.mp4”,
“cuts”: [
{
“start”: “00:00:01”,
“end”: “00:00:02”
},
{
“start”: “00:00:03”,
“end”: “00:00:05”
}
]
}
You can see the query input is actually perfect, but I can’t see how I’m suppose to configure the backend. The server doesn’t have an “array” type.
Hello StephenGPope.
I hope you are well.
I am speaking from Brazil, so forgive me if my English is a bit confusing, especially because I use a translation tool (both to translate what you need, and then I translate from Portuguese to English to answer you).
I found an adjustment that needs to be made in the cuts field:
Update the line in the JSON field to:
{
"video_url": "{{media_url}}",
"cuts": "{{JSON.stringify(cuts)}}"
}
In the ‘Placeholder Name’ for ‘cuts’, set the type to ‘String’.
I hope I have helped in some way.
Big hug.
Thanks!
Though, cuts is suppose to be an array, this would turn “cuts” into a string and assume the input to stringify would be an object.
Wouldn’t it be the opposite?
something like
{
“video_url”: “{media_url}”,
“cuts”: {{ JSON.parse({cuts}) }}
}
Also, it says to use {placeholder} single brackets
Still getting an error
Any ideas?
All the docs refer to using placeholders from previous modules, but these are the MCP server {placeholder}
I see. It really is annoying when this happens.
I see that in your Body you are mentioning “video_url”: “{media_url}”.
Try to make the correction below using video_url
{
"video_url": "{video_url}",
"cuts": {cuts}
}
If the error still persists, analyze the solution below and see if it makes sense to you.
The MCP server is expecting a valid object as input, but is receiving undefined, i.e. no content was sent in the body.
Probable cause:
The body field in the “Remove Cuts” node is not receiving the object generated in the previous node.
There may be mapping issues between the input (flow configuration) and what is actually sent to the server.
Suggestion:
{
"video_url": "{{inputData.video_url}}",
"cuts": {{inputData.cuts}}
}
Replace input Data.video_url and input Data.cuts with the correct placeholders linked to the previous node.
Check that cuts is being treated as raw JSON (array) and not string
I hope these two suggestions can bring the expected result.
Feel free to continue the conversation Mr. StephenGPope
Hi Stephen GPope, could you kindly mark my previous post as the solution (blue box with check mark) so that this ongoing discussion does not distract others who want to find out the answer to the original question? Thanks.
Thanks for your help.
This isn’t quite right though – there is no “previous node” as this is a MCP Server, the requests are coming from a Agent Tool.
the {video_url} isn’t really the problem, that part is working.
It’s the cuts, which are a {placeholder} coming from the client, not exactlly like the previous nodes {{ $json }}
The placeholders are defined in the server and are referenced with { }
The server is getting the currect data in string format, I can see it, but its not being properly mapped into the server {cuts} placeholder. In my previous screenshot you can see all the data.
Again thanks for your help.
Thank you for your reply, could you please share your workflow.
Below is an example of a workflow that was shared.
If you could share your workflow, I believe we can help better.Preformatted text