AI Tool Schema Builder

Build a function-calling tool once and export it for OpenAI Responses and Chat (strict mode), Anthropic, MCP and Gemini. Import and validate existing definitions.

The interactive tool loads here when JavaScript runs.

About this tool

What is the AI Tool Schema Builder?

Fill in a tool's name, description and parameters (string, number, integer, boolean, enum, arrays and nested objects, each with a description, required flag and default) and get the exact JSON each provider expects: OpenAI Responses and Chat Completions, Anthropic's Messages API, an MCP tools/list entry, a Gemini function declaration, or the bare JSON Schema.

Paste an existing definition from any of those formats, or a plain JSON Schema object, to edit it here and convert it to the others. Validation checks the name against every provider's rules, flags empty descriptions, duplicate or unnamed parameters, enums without values and defaults of the wrong type. It all runs in your browser.

  • Exports for OpenAI Responses, OpenAI Chat Completions, Anthropic, MCP, Gemini and plain JSON Schema
  • OpenAI strict mode applied recursively, including nested objects and array items
  • Name check against each provider with an automatic fix
  • Nested objects, arrays, enums and defaults
  • Import from any supported format or a bare JSON Schema
  • Validation messages and copy or download for each format
Read the guide: The Chief of Staff Agent: Designing Multi-Agent Systems That Finish the Job

Updated

How to use the AI Tool Schema Builder

  1. Type the tool name and a description that says what it does, when to use it and what it returns.
  2. Add parameters, choose their types, mark the required ones and add defaults or enum values.
  3. Read the checks; fix any red items.
  4. Choose OpenAI strict on or off, then pick an export tab and copy or download the JSON.
  5. To convert an existing tool, paste it in the import box and press Import and edit.

Worked examples

Optional enum in strict mode

Input

status: enum pending, shipped, delivered, cancelled; not required

Output

"type": ["string", "null"], "enum": ["pending", "shipped", "delivered", "cancelled", null], and status listed in required

Strict mode requires every key, so optional means "may be null" rather than "may be missing".

Anthropic export of the same tool

Input

Same tool, Anthropic tab

Output

"input_schema": { ..., "required": ["customer_id"] } with "default": 10 kept on limit

Without strict mode, optional fields are simply left out of required.

Background and insight

Every major API describes tool inputs with JSON Schema, but the wrapper differs. OpenAI's Responses API puts name, description, parameters and strict at the top of each tool; Chat Completions nests them under "function". Anthropic uses input_schema, MCP servers list tools with inputSchema (JSON Schema 2020-12 unless $schema says otherwise), and Gemini's FunctionDeclaration takes parametersJsonSchema or an OpenAPI-style parameters object.

Names have different limits. Chat Completions allows letters, digits, underscores and dashes up to 64 characters; Anthropic allows the same characters up to 128; Gemini also accepts dots and colons up to 128; the MCP specification recommends 1 to 128 characters including dots. The only name every provider accepts is ^[a-zA-Z0-9_-]{1,64}$, so the builder uses that as its target and offers a one-click fix.

OpenAI strict mode guarantees that arguments match the schema, at a price: additionalProperties must be false on every object, every property must be listed in required, and optional fields are expressed by allowing null. The builder applies those rules recursively when strict is on, moves defaults into the description (strict schemas do not use them), and leaves the Anthropic, MCP and Gemini exports in ordinary form with real optional fields and defaults.

Common use cases

  • Porting tools between providers

    Move a tool from OpenAI to Claude or Gemini without rewriting the schema by hand.

  • Turning on strict mode

    Convert a loose OpenAI schema into one that passes strict validation.

  • Writing MCP tools

    Draft the inputSchema for an MCP server tool before you code it.

  • Reviewing tool definitions

    Catch names that some providers reject and parameters without descriptions.

Tips and limitations

  • The description is the most important field: models decide whether to call a tool mostly from it.
  • Prefer enums over free text for fixed choices; models fill them more reliably.
  • Namespacing helps once you have many tools: github_list_prs reads better than list.
  • Keep nesting shallow. Deeply nested objects are harder for models to fill and some providers limit schema depth in strict mode.
  • Import keeps oneOf, anyOf and allOf parts as strings with a warning, because the form cannot edit unions.

Frequently asked questions

What characters are allowed in a function name?

For a name that works with every provider, use letters, digits, underscores and hyphens, up to 64 characters. Anthropic, Gemini and MCP allow longer names, and Gemini and MCP also allow dots, but OpenAI Chat Completions does not.

How do I make a parameter optional in OpenAI strict mode?

List it in required anyway and allow null as a type, for example "type": ["string", "null"]. Strict mode needs every property in required and additionalProperties set to false.

What is the difference between input_schema and inputSchema?

Same idea, different APIs. Anthropic's Messages API calls the tool's JSON Schema input_schema; the Model Context Protocol calls it inputSchema in tools/list.

Can I convert an OpenAI tool to Claude format?

Yes. Paste the OpenAI tool JSON into the import box, then open the Anthropic tab. The parameters, required list, enums and defaults carry over.

Does Gemini accept JSON Schema for function parameters?

Yes. A FunctionDeclaration can use parametersJsonSchema with JSON Schema, or the older parameters field, which takes a subset of the OpenAPI schema format.

Are defaults used by the model?

They are hints. The model sees them in the schema; your code still has to apply a default when an argument is missing. Strict mode on OpenAI does not use default, so the builder writes it into the description.

Is there an in-depth guide to the AI Tool Schema Builder?

Yes. “The Chief of Staff Agent: Designing Multi-Agent Systems That Finish the Job” covers the background, how it works, common pitfalls and worked examples. Read the full guide.