Received tool input did not match expected schema ✖ Required

Describe the problem/error/question

I’m getting this error for same data it runs but fails for some when it gets the same data

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

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

Could you share your workflow or a few screenshots showing the input where there’s the error?

Hi @Waqas_Rahim Welcome!
This seems like an AI agent issue with tools connected, although please provide more information.

And probable fixes for this is to use a stronger model in AI agent node also make sure to tell the AI agent on how to use that tool if it is that specific, the stronger model should solve the problem related to tools , use GPT-4 + models.

the intermittent part is the key clue — this isn’t a data problem, it’s the LLM occasionally deciding to omit a required field when it thinks it can infer it or when the input is ambiguous.

a few things that reliably reduce this:

1. make required fields explicit in the tool description — don’t just mark them as required in the schema, also spell it out in the description text: “you MUST always provide fieldName — never omit it even if you think it’s obvious”

2. check your $fromAI() type declarations — if any field uses auto-detected type, the schema can silently default to string even when the model sends a number or object. explicitly set the type: $fromAI(‘fieldName’, ‘description’, ‘number’)

3. lower the model temperature — intermittent schema failures almost always get worse at higher temperature. if you’re not explicitly setting it, try temperature: 0 for tool-heavy workflows

stronger model helps too as @Anshul_Namdev said, but usually the root cause is one of the above.