JSON to LLM Tool Schema
Turn an example arguments object into an LLM tool definition for the OpenAI and Anthropic APIs. Types are inferred in your browser, so your data never leaves your machine.
JSON engine. Nothing is uploaded or logged.About the JSON to LLM Tool Schema
JSON to LLM Tool Schema turns an example arguments object into a ready-to-use tool definition for the OpenAI and Anthropic APIs. You give it a function name, a description, and a sample of the arguments your tool receives, and it infers a JSON Schema for the parameters: types, nested objects, and arrays. It is built for developers wiring up function calling and agents who want a correct schema without writing it by hand. Everything runs in your browser, so your data is never uploaded.
How it works
- Enter a tool name and a short description of what the tool does.
- Paste an example arguments object, such as {"city":"Paris","days":3}.
- The tool reads the example, infers a JSON Schema for the parameters, and marks every top-level key as required.
- Switch between the OpenAI and Anthropic tabs and click Copy to grab the format you need.
Features
- Infers types from your example: string, number, integer, boolean, array, and object.
- Handles nested objects and arrays, including the item type of the first array element.
- Outputs both OpenAI tools format and Anthropic tools format, each pretty-printed with its own Copy button.
- Treats all top-level keys as required so the schema matches your example.
- Shows an inline error when the pasted JSON cannot be parsed.
Frequently asked questions
Is my data uploaded anywhere?
No. The tool parses your JSON and builds the schema entirely in your browser. Nothing is sent to a server or logged.
How are types decided?
Each value in your example is inspected. Whole numbers become integer and decimals become number. Strings, booleans, arrays, and objects map to their JSON Schema types. Arrays use the type of their first element as the item type.
Why are all keys marked as required?
The tool treats every top-level key in your example as required, since the example represents a complete set of arguments. You can edit the required list in the output if some fields are optional.
What is the difference between the two formats?
OpenAI wraps the schema in {type:'function', function:{name, description, parameters}}. Anthropic uses {name, description, input_schema}. The parameter schema itself is the same in both.
What if my example has nested objects or arrays?
Nested objects get their own properties block, and arrays get an items definition based on the first element. Deeper structures are handled recursively, so you can paste realistic argument shapes.