JSON Schema to LLM Tool Definition.
Wrap a JSON Schema as a function/tool definition for OpenAI, Anthropic and MCP, with optional strict mode.
Runs in your browserAbout JSON Schema to LLM Tool Definition
JSON Schema to Tool Definition wraps a schema in the exact envelope each LLM API expects, so you can define a tool once and use it with several providers. Paste an object schema, such as one generated from a Pydantic model, a Zod schema or a TypeScript type, and get four outputs: an OpenAI Chat Completions tool with type function and a nested function object, an OpenAI Responses API tool where name and parameters sit at the top level, an Anthropic Messages API tool with input_schema, and an MCP tools/list entry with inputSchema. The tool name and description default to the schema's title and description, and the $schema and $id keywords are removed because tool APIs expect a bare schema. Strict mode prepares the schema for OpenAI structured function calling, where the model is guaranteed to match the schema. Strict mode has two rules that trip people up: every property must be listed in required, and every object must set additionalProperties to false. The converter applies both recursively, including nested objects, array items and $defs, and turns optional properties into nullable ones so their meaning is kept; for example an optional unit enum becomes type ["string", "null"] with null added to the enum. The notes list every change. Other providers receive your original schema untouched. Remember that models choose tools by name and description, so a clear description matters as much as the schema. Conversion happens in your browser.
How to Use
- Paste a JSON Schema whose root is an object with properties.
- Set the tool name and description, or let them come from the schema title and description.
- Turn on strict mode for OpenAI structured function calls and copy the definition for your provider.
Frequently Asked Questions
What does strict mode change?
It sets additionalProperties to false on every object and lists all properties as required. Optional properties become nullable so the model can still leave them empty. Only the OpenAI outputs are changed.
What are the tool name rules?
Use letters, digits, underscores and dashes, up to 64 characters. OpenAI and Anthropic both reject names with spaces or dots.
Can the root be an array or a string?
No. Tool inputs are always JSON objects. Wrap other types in an object property, for example {"items": [...]}.
Is my schema uploaded?
No. Everything runs in your browser.
Related Tools
Convert Chat Completions requests to Anthropic Messages requests and back, including tools and images.
Generate typed code from JSON data.
Generate a Laravel Eloquent model, casts and FormRequest validation rules from a sample JSON payload.
Paste a JSON Schema and get realistic sample JSON that follows its types, formats, enums and constraints.
Connect to a remote MCP server over Streamable HTTP and list its tools, resources and prompts.
View JSON Lines as a table, convert JSONL ↔ JSON arrays, and check chat fine-tuning datasets.