I updated one of the tools for my AI Agent, and it starts to give me error message.
But I can’t find what the input was given to the tool, and which tool it was trying to call, does anyone else facing this issue?
I’m on a n8n instance hosted in our cloud which I can’t manage.
What is the error message (if any)?
Problem in node ‘AI Agent‘
Received tool input did not match expected schema
This error, from what I’ve seen on the forum (and this issue comes up rather regularly), is about either naming for the tools or fields or clarity of the system prompt. Try checking if you are passing the right names, verify how straightforward your prompt is, check the execution logs. You can also try to embed your flow here, we can try to take a look.
I’m able to identify the issue as I used $fromAI() function with the same input parameter twice, hopping it will put the same input into 2 different place.
Once I changed the second one to $fromAI(“parameter2”,“samevalue as parameter”,"string}, the error dissapeared.
However, my concern remains that the error does not point out which tool was facing the issue, and what was the input AI Agent was trying to give.
You can see the values passed into tools in the Logs section. For example, this simple workflow has three tools - for adding numbers, subtracting numbers and sending emails. It takes two numbers from the chat, determines which operation is needed and then calls an appropriate tool. Then it sends the email to the user. The Send email tool uses $fromAI('result') to pass the result of the mind blowing mathematical operation to the user.
Unfortunately I’m not able to attache the actual workflow, but this is what I got when it’s errored out
with no information about which tool it’s trying to invoke and what input it gives.
The first thing that I saw when I looked at the image was:
Not that it is necessarily a problem, it would still bother me
As to why this happened and how would you go about troubleshooting - yeah, good question, if you would like to contribute to this bug, that would be great.