Skip to content

Tool

Tool Schema Validator

Paste a tool definition in OpenAI, Anthropic or MCP form. You get a checklist of problems, the same tool in the other two formats, and how many tokens the definition adds to every request that includes it.

OpenAI function tool, Anthropic tool or MCP tool; the format is detected. Nothing leaves your browser.

Detected format

OpenAI

Errors (1)

  • "required" lists "sort", which is not defined in "properties".

    #/required

Notes (3)

  • Consider "additionalProperties": false. It is required by OpenAI strict mode and stops the model inventing extra keys.

    #

  • Property "status" has no description. A short one helps the model fill it correctly.

    #/properties/status

  • Property "limit" has no description. A short one helps the model fill it correctly.

    #/properties/limit

Definition size: ≈ 199 tokens (estimate, exact count loading)

Convert to

Anthropic tool definition

{
  "name": "search_orders",
  "description": "Search a customer's orders by status and date range. Returns at most 20 orders.",
  "input_schema": {
    "type": "object",
    "properties": {
      "customerId": {
        "type": "string",
        "description": "The customer's ID."
      },
      "status": {
        "type": "string",
        "enum": [
          "open",
          "shipped",
          "cancelled"
        ]
      },
      "limit": {
        "type": "integer",
        "minimum": 1,
        "maximum": 20
      }
    },
    "required": [
      "customerId",
      "sort"
    ]
  }
}

What it checks

Each tool is a name, a description and a JSON Schema for its arguments. The checks cover the mistakes that make a provider reject the definition or make a model call it badly. The name must be letters, digits, underscores or hyphens, at most 64 characters. The description must exist and say more than a few words. The root schema must be an object with properties, and every key in required must actually be one of those properties.

Beyond hard errors it warns or adds a note about things that work but hurt: properties without descriptions, objects nested deeply enough that models start to lose track, $ref cycles, and keywords that some providers ignore or refuse. When a definition asks for strict mode, it also checks the two rules strict mode relies on: every object closed with additionalProperties set to false, and every property listed in required.

A worked example

The example above is an order search tool in OpenAI form. It reads cleanly, and it is broken. The required list names sort, which is not a property, so a provider will reject it or the model will be told to send an argument the schema never defines. The validator reports that as an error with the path to the required list.

It also notes that status and limit have no description. The enum gives the model the allowed values for status, but not when to use which; a short sentence per property is cheap and is the single most effective fix for wrong tool arguments. Delete sort from required, add the two descriptions, and the error list empties as you type.

Converting between formats

The three formats carry the same three things under different keys. OpenAI wraps them as a function object with parameters. Anthropic uses input_schema at the top level. MCP uses inputSchema. The Convert to tabs rewrap your definition for each, with the schema itself unchanged, so one source of truth can serve an OpenAI integration, a Claude integration and an MCP server.

Provider-specific flags such as strict do not carry across, because the other formats have no slot for them. If you depend on one, add it back after converting.

Why the token size matters

Tool definitions are sent with every request that offers the tool, so they are part of your input on every turn of an agent loop. A verbose schema for ten tools can be thousands of tokens before the user has typed anything. The count is exact for the OpenAI o200k_base encoding when it has loaded, and a labelled estimate otherwise, the same way the token counter on this site reports it.

What a static check cannot know

These rules reflect common provider requirements, and providers change them. Passing here does not guarantee a provider accepts the definition, and a warning here may not apply to the provider you use. The validator also cannot see your handler: it cannot tell whether the code behind the tool accepts what the schema promises, or whether the description matches what the tool really does. Keep a test that sends a real tool call through your handler, and validate arguments with a schema at runtime, because a model can still send arguments that do not match.

Frequently asked questions

Is my tool definition uploaded?

No. Validation, conversion and token counting all run in your browser. The last definition is kept in this browser's storage, and a share link includes it only if you copy one.

What is not supported?

Lists of tools, provider server tools and anything that is not a single function-style definition. Remote $ref URLs are not fetched. Paste one tool at a time.

Why describe tool schemas with Zod?

A tool schema is a contract between the model and your code. Writing it once in Zod gives you the JSON Schema to send, the type for your handler and a runtime check on the arguments, so the three cannot drift. The JSON to Zod tool turns an existing schema into that starting point.

Does passing every check mean the tool will work?

It means the definition avoids common mistakes. Providers each have their own rules and change them over time, so treat a clean result as a good sign, then confirm with a real call.

Related tools

  • Token Counter

    Count tokens for any text, exactly for OpenAI models and estimated for Claude, in your browser.

  • Claude Token Counter

    Estimate Claude tokens and input cost for a prompt, with the limits of estimating spelled out.

  • OpenAI Token Counter

    Exact o200k_base token counts for GPT-style prompts, computed locally.

  • Agent Framework Picker

    Five questions to decide between a plain loop, an SDK, or a framework.

  • LLM Cost Calculator

    Estimate what an LLM feature costs per request, per day and per month from your own token counts and prices.

  • Agent Run Budget Simulator

    See how an AI agent's cost grows turn by turn and where your budget cap would stop it.

  • JSON to Zod

    Paste a JSON sample or a JSON Schema and get a Zod schema and TypeScript types, in your browser.

Read the guide →