Received tool input did not match expected schema

hi im try with agent ai node and openai model with google sheet tool but on 10 run 8 run return “Received tool input did not match expected schema”

how can fix that?

Last n8n version self host.

1 Like

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hi @mredodos

Welcome to the community :tada:

If you’re seeing the error “Received tool input did not match expected schema,” it typically means the data you’re sending to a node isn’t in the right format. To fix it, start by checking the data itself—make sure it matches the expected schema in terms of data types, field names, and required fields. Then, review the configuration of the node that’s throwing the error. Double-check that all the parameters are set correctly and that any dynamic expressions are resolving as expected. Either way, to troubleshoot this it would be helpful if you could post your workflow JSON here

Tip for sharing your workflow in the forum

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

Make sure that you’ve removed any sensitive information from your workflow and include dummy data or pinned data as much as you can!


Idk because in 10 run is all the same settings but 2 time on 10 return error

1 Like

Most commonly it’s the naming convention for your tools that doesn’t match. E.g database_tool vs database1

To add to this is if you share buffer memory between agents you can accidentally call a tool from the wrong agent and that will give you “Received tool input did not match expected schema”

1 Like

but works for 10 runs and just some time going error…

1 Like

I encountered the same issue when I had an optional parameter that could be null or undefined. To resolve this, I instructed the agent to output an empty string instead of null or undefined when the parameter is not provided.

4 Likes

Hello all,

This is my very first post here. And after having wrestling with this error, I can elaborate a few things that you might want to pay closer attention to. The reason I say this is because some of the tools you may be testing externally may work, but when they are called via an LLM, some of the causes for failures may not even have crossed our minds.

Failure Reason #1

This is a PATCH API call that works when tested in Postman the following 2 ways:

It will work even if you remove the “id” attribute from the JSON body. Here is how that looks:

But if I write a tool call using Python of JavaScript based on the second method, the tool call fails with the “schema mismatch error”. Therefore, it is important that "id" attribute be provided in the stringify call. If the “id” is missing, this can be one of the reason’s of a schema mismatch error.

Failure Reason #2

This is easily missed. The Web server expects the following parameters in the request object.

Example:

The server expects id, name, a date in the iso 8601 format and location.

But if the date isn’t passed in the ISO-8601 format, the tool call fails because the API call will fail causing the mismatch error to show in the chat response.

Likewise, on the client side, the parameters must match when making the API call.

This works because the parameter names in the stringify match:

request_body = JSON.stringify({
id: $id,
name: $event_name,
date: $event_date,
location: $event_location
});

But this call will cause a tool call to fail with schema mismatch error.

request_body = JSON.stringify({
id: $id,
event_name: $event_name,
event_date: $event_date,
event_location: $event_location
});

Failure Reason #3: May require better tool descriptions or prompts

I experienced this at least a couple of times when I made this request to the agent:

Create a new event ‘my event name’ for June 30 2025 to be held in Boston, MA.

The tool call failed, but this time the agent came back with a proper error paraphrased:

" the date is not in the proper format. Excepted format is YYYY-MM-DD…’

To be fair, there is no description in the tool call that states that the date will need to be passed in with a specific format. Also, it is not always possible to change the tool description especially if it’s been created by someone else.

Therefore, a slight prompt adjustment will help. I added this to each of my agent prompts:

image

I hope this helps because I was able to create a multi-agent flow that can create, update, delete or list events. And all agents ride on less powerful small language models.

Cheers!
-Andy

Yeah, same thing here

Hi, i was having the same issue.
i just tried a workaround using a simple workflow tool with just a google sheet node inside it, and now AI agent doesn’t have error, even faster lol