JSON to LLM Tool Schema

Paste an example of the arguments you want the model to send. You get a ready-to-use tool definition for Claude, OpenAI, Gemini or an MCP server, including strict mode and structured output variants.

Example arguments (JSON)
Press Ctrl + Enter to generate
Tool definition

How it works

  1. Give an examplePaste the arguments you would like the model to produce. Numbers, booleans, nested objects and arrays are all typed from the values.
  2. Pick a providerClaude, OpenAI, Gemini and MCP each wrap the same JSON Schema differently. The output matches the provider you choose.
  3. Choose strictnessStrict mode closes every object and requires every field, which is what schema-constrained decoding needs.
  4. RefineAdd descriptions and enums where they help the model, then paste the result into your request.

Tool use vs structured outputs

Tool use (also called function calling) lets the model decide to call one of your functions and fill in its arguments. You run the function and send back the result. Use it for actions and lookups. Structured outputs constrain the model's final answer to a JSON Schema, which is the right choice when you only want data back, for example extracting fields from a document. Both use the same schema language, so this generator produces either from one example.

With strict mode on, Claude ("strict": true on the tool) and OpenAI ("strict": true on the function) guarantee the arguments validate against your schema. That requires additionalProperties: false on every object and every property listed in required. Fields that were missing from some of your examples are made nullable so they can still be left empty.

Where the output goes

  • Claude tool: an entry in the tools array of a Messages API request.
  • Claude structured output: merge the output_config object into your Messages API request.
  • OpenAI Chat Completions: an entry in tools. The Responses API uses the flatter shape without the nested function key.
  • OpenAI structured output: the response_format parameter of a Chat Completions request.
  • Gemini: an entry in the tools list of a generateContent request.
  • MCP: what your server returns for the tool from tools/list.

Frequently asked questions

Why are my fields typed as integer instead of number?

Whole numbers in the example become integer and numbers with a decimal point become number. If a field can be fractional, give an example like 2.5, or include both 2 and 2.5 across an array of examples and the types are merged to number.

How do I make a field optional?

Paste an array of example objects. Any field that does not appear in every example is left out of required in normal mode. In strict mode every field must be required, so optional fields become nullable instead, which is the pattern Claude and OpenAI recommend.

What does Detect string formats do?

It adds a format keyword for strings that look like dates, date-times, emails, UUIDs or URLs. Formats give the model a strong hint and let validators check the value. Gemini's schema subset only accepts date-time and enum formats, so other formats are left out for Gemini.

Why is null turned into a string type?

A null in the example says the field can be empty but not what it holds when it is set. It is typed as a nullable string, which you can change to the real type. Claude, OpenAI and MCP express this as a type array with null; Gemini uses nullable: true.

Is anything sent to an AI provider?

No. The schema is generated in your browser from the example you paste. Nothing is sent to Anthropic, OpenAI, Google or to our servers.

Related AI tools