I get [ERROR: Received tool input did not match expected schema] before the agent attempts to use any tools!

Describe the problem/error/question

I get this error [ERROR: Received tool input did not match expected schema] every time I send a message to the AI Agent. I am getting this error even before the agent attempts to use any tools.

What is the error message (if any)?

[ERROR: Received tool input did not match expected schema]

Please share your workflow

Here, I replaced confidential and other private values with random words. You will need to configure them on your own before running.

Share the output returned by the last node

[ERROR: Received tool input did not match expected schema]

Information on your n8n setup

  • n8n version: 2.2 (Latest)
  • Database (default: SQLite): Simple Memory
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Windows 11 Home

Hi Jurabek. Here’s what that error means and how to fix it quickly.

What the error really is:

Received tool input did not match expected schema is thrown by the AI Agent when the model decides to call one of your tools but the arguments it sent do not validate against the tool’s input JSON-Schema. This can happen even when you just say “hi” — some models send a (sometimes empty) tool-call and the Agent validates it before running anything. If the schema says a field is required (or has the wrong type), validation fails and you get this error. It’s also easy to hit with HTTP tools when the body/shape is left for the model to decide.

Fastest way to get unblocked:

  1. Confirm it’s a tool-schema problem

    • Disable all tools in the Agent → send “hello”. If it runs, re-enable tools one by one to find the offending tool.
  2. Make each tool’s input schema permissive until it works

    • Open the Contacts Database and Send Email tool nodes → Tool tab → Input schema.

    • Start permissive (no required properties) so an empty call won’t crash:

      {
        "type": "object",
        "properties": {},
        "additionalProperties": true
      }
      
      
    • Test again. If it no longer errors, you’ve confirmed the cause (a too-strict schema or wrong keys).

  3. Then tighten the schema with the exact keys the model should send

    • Example for Send Email:

      {
        "type": "object",
        "properties": {
          "to":      { "type": "string", "description": "Email address" },
          "subject": { "type": "string" },
          "text":    { "type": "string" }
        },
        "required": ["to","subject","text"],
        "additionalProperties": false
      }
      
      
    • In your Agent’s system prompt, repeat the tool name and show one concrete example of a valid call (models follow examples much more reliably). Community users report this reduces schema-mismatch errors a lot.

  4. If you use an HTTP Request tool with “let model specify entire body”

    • Either (a) give a very permissive schema for the body (no required, additionalProperties:true), or

    • (b) pre-build a template object and let the model fill only specific fields; otherwise the Agent often fails validation on the free-form body.

  5. Guard against empty tool-calls

    • Some models occasionally send {} for arguments; this has been discussed as a known behavior leading to this exact error. Keeping “required” empty or adding sensible defaults prevents random failures.
  6. Model sanity check

    • If you still see the error with permissive schemas, try a different model vendor once (e.g., swap Groq → OpenAI/Claude or vice-versa). There are open reports of sporadic schema mismatches across vendors.

A concrete checklist for your workflow:

  • Disable both tools → message runs? If yes, continue.

  • Re-enable Contacts Database only with the permissive schema shown above → test.

  • Re-enable Send Email only with the permissive schema → test.

  • When each tool works, replace permissive schemas with the exact keys you want (and keep additionalProperties:false).

  • In the Agent’s system prompt, spell out the required fields and give one example JSON of a correct tool input.

  • If you use an HTTP tool with free-form body, follow step 4.

  • If random failures remain, try another model (step 6).


  • The Agent validates tool arguments against the JSON-Schema you define; mismatches trigger your exact error.

  • Models sometimes issue empty tool calls, which fail when your schema has required fields.

  • Letting the model “specify entire body” without a friendly schema almost guarantees validation mismatches.

If you want, paste the current tool schemas you’re using and one sample user question; I can suggest a minimal, robust schema + example prompt that will keep the Agent from tripping over validation.

When you see the AI Agent throw “Received tool input did not match expected schema” before it even touches any of your downstream nodes, it means the agent is trying to call a tool but the arguments it sends don’t validate against the tool’s JSON schema. This typically happens in three situations:

  1. Your tool’s input schema is too strict or mismatched.
    In the Tool tab of each node you expose to the agent you define an input schema. That schema tells the validator which keys and types are allowed and which are required. If the model sends a different key, a different type, or omits a required field, n8n raises this errorcommunity.n8n.io. This is why the error appears “before” the tool runs – n8n validates the call first.

  2. The model sometimes issues empty calls.
    Large‑language‑model tools sometimes send an empty {} as arguments when they don’t intend to run a tool. If your schema contains any required fields, that empty call will fail validation immediately.

  3. Mismatched field names between the schema and your prompt.
    The field names you use in the system prompt (“to”, “subject”, “body”, etc.) must match exactly the property names you declared in the schema. If you call a field recipientEmail in your prompt but your schema defines to, validation will fail.

How to fix it

  • Loosen your schema to confirm the cause. Temporarily remove all required fields and set additionalProperties: true in your tool’s schema:

    {
      "type": "object",
      "properties": {},
      "additionalProperties": true
    }
    
    

    With this permissive schema the agent can send an empty object without error. If your workflow runs, you’ve identified the source of the problem.

  • Add back required fields and align names. After confirming, gradually add your fields back. For a mail tool, for example:

    {
      "type": "object",
      "properties": {
        "to":      { "type": "string", "description": "Recipient email" },
        "subject": { "type": "string" },
        "text":    { "type": "string" }
      },
      "required": ["to","subject","text"],
      "additionalProperties": false
    }
    
    

    Then in your system prompt, show the agent exactly how to call the tool, using these property names (for instance: {"``to":"[email protected]``","subject":"Hello","text":"Message"}).

  • Avoid “Let Model Specify Entire Body” for HTTP tools. If you’re using an HTTP Request node with Let Model Specify Entire Body, define the body structure yourself in a preceding Set or Code node and expose only the dynamic fields to the model. This prevents the model from sending a free‑form object that fails validation.

  • Update n8n if you’re on an early v2.2 build. There were early 2.x builds where the agent attempted to validate even when no tool should be called. Updating to the latest 2.2.1+ release fixes this behaviour.

With the schema relaxed and the property names aligned, your agent should stop throwing the validation error and start invoking your Contacts database or Send Email tools correctly.