{} LLM JSON Schema View source ↗

Anthropic · tool input_schema

tools.0.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12

Claude rejects a tool schema with properties but no required

This generic-looking error almost always has one specific cause: your tool's input_schema declares properties but omits the required array. Claude's validator (strictest on thinking models) treats that as invalid. The fix is one line.

What the error means

Claude validates each tool input_schema against JSON Schema draft 2020-12, and requires required to be present whenever an object has properties — even if nothing is actually mandatory. Schema generators (e.g. Zod-to-JSON-Schema) frequently emit properties with no required key for all-optional objects, which trips this. Thinking models enforce it most aggressively.

The fix

Add a required array. If no field is mandatory, an empty array is valid:

# before — properties present, no "required" → "JSON schema is invalid" { "type": "object", "properties": { "limit": { "type": "number" } } } # after — add required (empty array is fine when nothing is mandatory) { "type": "object", "properties": { "limit": { "type": "number" } }, "required": [] }

Don't confuse this with OpenAI

Anthropic only requires required to exist — an empty array passes. OpenAI's strict Structured Outputs is stricter: required must list every key in properties. Same field, two different rules — a converter that targets the wrong one produces a schema the other provider rejects.

Fix it automatically

Paste your schema, pick Anthropic, and the converter adds a required array wherever an object has properties without one — annotated with the rule. Switch the target to OpenAI and it upgrades the same field to list every key. All in-browser; nothing uploaded.

Open the converter →
Anthropic tool-use docs ↗