Loading...

Schema Converter

Tool / Function Schema Converter

Convert a tool/function definition between OpenAI, Anthropic, and Google Gemini formats, with warnings for fields that don't map cleanly.

Updated FreeNo signup

Detected: OpenAI

{
  "name": "get_weather",
  "description": "Get the current weather for a location.",
  "input_schema": {
    "type": "object",
    "properties": {
      "location": {
        "type": "string",
        "description": "City and state, e.g. San Francisco, CA"
      },
      "unit": {
        "type": "string",
        "enum": [
          "celsius",
          "fahrenheit"
        ],
        "description": "Temperature unit"
      }
    },
    "required": [
      "location"
    ],
    "additionalProperties": false
  }
}

TL;DR

Paste an OpenAI, Anthropic, or Gemini tool definition and convert it to another provider's format. The main differences: OpenAI wraps the schema under function.parameters, Anthropic uses input_schema, and Gemini uses functionDeclarations with a reduced, UPPERCASE-typed JSON-Schema subset. The full field-mapping table is below, and the converter warns you about constructs that don't map cleanly.

Format comparison

Updated Jul 5, 2026
Field-by-field comparison of OpenAI, Anthropic, and Gemini tool-definition formats
ConceptOpenAIAnthropicGemini
Envelope / wrapper{ type: "function", function: { … } } (Chat Completions) or flattened (Responses)bare { … } object (no wrapper)an entry inside functionDeclarations: [ … ]
Input schema fieldparametersinput_schemaparameters (or parametersJsonSchema)
Schema type casinglowercase JSON Schema ("string", "object")lowercase JSON Schema ("string", "object")UPPERCASE OpenAPI enum (STRING, OBJECT)
Nullability["string", "null"] type union["string", "null"] or anyOf with nullnullable: true
Strict / guaranteed conformancestrict: true (needs additionalProperties: false + all keys required)strict: true (opt-in, no rewrite)no per-tool flag (use controlled generation / parametersJsonSchema)
Name constraints^[a-zA-Z0-9_-]{1,64}$^[a-zA-Z0-9_-]{1,64}$up to 128 chars; also allows . and :
Forcing a tool calltool_choice (auto / required / none / named)tool_choice { type: auto | any | tool | none }toolConfig.functionCallingConfig.mode (AUTO / ANY / NONE)

How it works

The converter normalizes any provider shape to an internal representation — { name, description, parameters } where parameters is standard JSON Schema — then emits the target format. Conversion is a pure, client-side transformation; nothing is uploaded.

When targeting Gemini it uppercases JSON-Schema types to the OpenAPI enum, converts ["type","null"] unions to nullable: true, and drops keywords Gemini's native schema doesn't support ($ref, oneOf, allOf, not, additionalProperties) — each with a warning. Verify the output against the provider's current docs before shipping; these formats evolve.

FAQ

What's the difference between OpenAI, Anthropic, and Gemini tool formats?
OpenAI wraps each tool in {type: "function", function: {…}} and puts the JSON Schema under "parameters". Anthropic uses a bare {name, description, input_schema} object — the schema key is "input_schema". Gemini nests declarations under functionDeclarations and its native schema uses UPPERCASE OpenAPI types (STRING, OBJECT) instead of lowercase JSON Schema.
How do I convert an OpenAI function to Anthropic tool use?
Move the definition out of the function wrapper, rename "parameters" to "input_schema", and drop the {type: "function"} wrapper. The JSON Schema itself is compatible — both use lowercase types. This tool does it automatically; paste your OpenAI tool and pick Anthropic as the target.
Why does Gemini need a different schema?
Gemini's native "parameters" is a reduced OpenAPI 3.0 subset with UPPERCASE type names and no support for $ref, oneOf, allOf, not, patternProperties, or additionalProperties. Converting to Gemini uppercases the types, maps type unions to nullable: true, and drops unsupported constructs (with a warning). Gemini's parametersJsonSchema field accepts fuller standard JSON Schema if you need it.
Does converting change how the model calls the tool?
No — the tool's name, description, and parameter structure are preserved. The converter only reshapes the envelope and adapts schema syntax to each provider's rules. Warnings flag any construct that can't map cleanly so you can adjust it before shipping.