Anthropic Tool Schema Validator

Validate Anthropic Claude tool definitions before sending them to the API.

Paste your Claude tool definition JSON and validate it against Anthropic's tool-use spec — tool name format, required description, input_schema structure, property types, and nesting depth — so the Messages API accepts it cleanly. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does an Anthropic tool differ from an OpenAI one?

Anthropic tools use input_schema (a JSON Schema object) rather than parameters, and the tool object is flat — name, description, and input_schema at the top level — instead of nested under a function key.

Validate Claude tool definitions

Claude’s tool use relies on a precise tool schema, and a malformed input_schema or a thin description leads to rejected requests or poor tool selection. Paste your tool definition here and get an instant checklist against Anthropic’s spec — name format, description quality, input_schema structure, property types, and nesting depth — before you add it to your tools array.

How it works

The validator parses your JSON and checks the shape Anthropic expects: a flat object with name, description, and input_schema. Unlike OpenAI’s nested function.parameters, Anthropic puts the JSON Schema directly under input_schema, which must be { "type": "object", "properties": { … } }. The tool verifies the name matches the allowed pattern, the description is present and substantive, every property declares a type, and the schema isn’t nested too deeply for Claude to fill reliably.

What a valid Anthropic tool definition looks like

{
  "name": "get_weather",
  "description": "Fetch the current weather for a location. Call this when the user asks about weather conditions, temperature, or whether to bring an umbrella.",
  "input_schema": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "The city and country, e.g. London, UK"
      },
      "unit": {
        "type": "string",
        "enum": ["celsius", "fahrenheit"],
        "description": "Temperature unit, defaults to celsius"
      }
    },
    "required": ["location"]
  }
}

What the validator checks

CheckWhy it matters
Name matches ^[a-zA-Z0-9_-]{1,64}$Spaces or punctuation cause the API to reject the tool array
Description present and non-trivialClaude selects tools primarily from descriptions; thin descriptions lead to missed or wrong calls
input_schema is type: objectThe API requires a JSON Schema object at the top level
All properties declare a typeUntyped properties confuse Claude about what to fill in
Nesting depth is reasonableDeeply nested schemas produce unreliable fills; flatten where possible

Common mistakes

  • Wrapping in a function key. Anthropic’s format is flat — name, description, input_schema at the top level. OpenAI wraps in {"type": "function", "function": {...}}; these are not interchangeable.
  • Omitting required. Without a required array Claude may leave out inputs you need, since it cannot distinguish truly optional from accidentally omitted fields.
  • Vague descriptions. “Looks up a value” is not enough. Describe what trigger should prompt Claude to call the tool and what each parameter controls.
  • Free-form strings where enums work. If a field accepts only "asc" or "desc", say so with an enum — it dramatically reduces hallucinated values.

Tips

  • Write rich descriptions. Claude leans on the tool description more than most models; explain when to use the tool and what each field means.
  • Use required explicitly so Claude knows which inputs it must provide.
  • Prefer enums and flat structures over free-form strings and deep nesting — they produce far more reliable tool calls.