JSON Schema to LLM tool definition: OpenAI, Claude, Gemini
You're building an app where the bot can run your function (check the weather, save something to a database, send an email). The official name is function calling (OpenAI and Google) or tool use (Anthropic). To tell the bot what it can call, you describe each function in JSON Schema, a format the bot understands: *"this is the function name, these are its arguments, these are the required types"*.
The problem: each provider sticks to its own format. OpenAI wraps the schema in `{ type: "function", function: {...} }`. Anthropic uses `input_schema` instead of `parameters`. Google Gemini stuffs everything into a `functionDeclarations` array. Same concept, three different syntaxes.
Paste your JSON Schema once, get ready-to-use definitions for all three providers. Plus a ready TypeScript snippet with the API call (`chat.completions.create`, `messages.create`, `generateContent`), drop it into your code and you're done.
How to use it
- Paste your function's JSON Schema. Needs three fields: `name` (the name), `description` (what it does) and `parameters` (what arguments it takes).
- The validator checks the schema as you type. Green OK = all good, red error = we point out exactly what's wrong.
- Pick the target provider: OpenAI, Anthropic or Gemini.
- JSON only / Code sample toggle: the first gives you the bare schema, the second a ready TypeScript snippet with the API call.
- Copy the result. Paste it into your code, into curl, into Postman, wherever you need it.
When this is useful
Six typical situations where this converter gives you a concrete edge:
- Migrating from OpenAI to Claude (or to Gemini). Your app has 50 functions defined for GPT-4o, the client wants to switch to Claude. Instead of rewriting each schema by hand (and making typos), you paste them through the converter one by one and you're done.
- App that uses several models at once. A cheap model for easy tasks, a pricier one for hard ones. Each needs the schema in its own format. One source of truth (your JSON Schema) → three consistent versions on the output.
- Junior dev learning function calling. Reading three sets of docs takes an hour you don't have. Here you see immediately: *"this is what it looks like for OpenAI, this for Claude, this for Gemini"*. Five minutes and you understand the differences.
- Quick prototype. Testing an idea for a function. Start with OpenAI (cheaper, faster), it works? Convert to Claude (better quality on more complex queries). No rewriting from scratch.
- Documenting an API for clients. You have a public API and want clients to be able to plug it into an LLM. You generate three versions (OpenAI, Anthropic, Gemini) and put them in your docs, let clients pick whichever fits.
- *"My bot won't call my function"*. Classic junior problem. Reason number one: a bug in the schema (typo in `type`, wrong nesting, missing field). The validator here flags it immediately, before you ship a request to the API and pay for a broken call.