Tool Schema Converter & Linter for LLM APIs
Paste a function or tool definition written for one LLM API and get the equivalent for OpenAI, Anthropic, Gemini and MCP, with a list of what each target could not carry over and a lint report against each provider’s documented rules.
Detected: MCP tool definition · single tool · 1 tool
Converted
Conversion notes: OpenAI Chat
Everything the selected target could not carry over unchanged.
- Changed Name "weather.get_forecast" rewritten as "weather_get_forecast" to fit OpenAI Chat's name rule (a-z, A-Z, 0-9, underscore and dash; max 64). Map it back when you dispatch the call.
- Dropped Output schema dropped: OpenAI Chat tool definitions have no field for it.
- Dropped title "Weather Forecast" dropped: only MCP has a separate display title.
- Dropped annotations dropped (readOnlyHint, openWorldHint): MCP behaviour hints have no equivalent in OpenAI Chat.
Lint report
2 errors · 1 warning · 0 info
Checked against each provider’s documented rules. “Applies to” names the formats a finding affects.
weather.get_forecast
- Error — Name "weather.get_forecast" contains ".". OpenAI allows only a-z, A-Z, 0-9, underscore and dash, up to 64 characters. The converted output substitutes "weather_get_forecast". Applies to: OpenAI Chat, OpenAI Responses
- Error — Name "weather.get_forecast" contains ".". Anthropic allows only a-z, A-Z, 0-9, underscore and dash, up to 128 characters. The converted output substitutes "weather_get_forecast". Applies to: Anthropic
- Warning
days— Parameter "days" has no description. State its meaning, format and an example; the model fills arguments from this text.
The five tool definition formats side by side
All five describe arguments with JSON Schema. They differ in the wrapper, the schema field name, the characters allowed in a tool name, and whether a strict flag exists.
| Format | Shape | Schema field | Name rule | Strict mode |
|---|---|---|---|---|
| OpenAI Chat Completions | { "type": "function", "function": { … } } | function.parameters; omitting it means no parameters | a-z, A-Z, 0-9, _, -; max 64 | function.strict, off by default |
| OpenAI Responses | Flat: { "type": "function", "name": …, "parameters": … } | parameters | Not restated in the Responses reference; this tool applies the Chat Completions rule | strict; if omitted the API tries to normalise the schema into strict mode |
| Anthropic Messages | { "name", "description", "input_schema" } | input_schema | ^[a-zA-Z0-9_-]{1,128}$ | strict: true on the tool |
| Gemini (generateContent) | { "functionDeclarations": [ … ] } inside tools | parameters (OpenAPI 3.0 subset) or parametersJsonSchema | a-z, A-Z, 0-9, _, :, ., -; max 128 | No per-function flag |
| MCP (2026-07-28) | Tool object in a tools/list result | inputSchema (JSON Schema 2020-12 by default); root must be type: "object" | SHOULD be 1–128 characters of A-Z, a-z, 0-9, _, -, . | None; the client decides how to enforce the schema |
Gemini’s Interactions API takes a flat { "type": "function", "name", "description", "parameters" } object, the same shape as an OpenAI Responses tool.
One tool written in each format
The same two-parameter weather tool. Only the envelope changes; the schema body is identical in all five.
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Returns current weather for a city.",
"parameters": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name, e.g. Lisbon" },
"units": { "type": "string", "enum": ["metric", "imperial"] }
},
"required": ["city"]
}
}
}{
"type": "function",
"name": "get_weather",
"description": "Returns current weather for a city.",
"parameters": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name, e.g. Lisbon" },
"units": { "type": "string", "enum": ["metric", "imperial"] }
},
"required": ["city"]
}
}{
"name": "get_weather",
"description": "Returns current weather for a city.",
"input_schema": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name, e.g. Lisbon" },
"units": { "type": "string", "enum": ["metric", "imperial"] }
},
"required": ["city"]
}
}{
"functionDeclarations": [
{
"name": "get_weather",
"description": "Returns current weather for a city.",
"parameters": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name, e.g. Lisbon" },
"units": { "type": "string", "enum": ["metric", "imperial"] }
},
"required": ["city"]
}
}
]
}{
"name": "get_weather",
"title": "Current Weather",
"description": "Returns current weather for a city.",
"inputSchema": {
"type": "object",
"properties": {
"city": { "type": "string", "description": "City name, e.g. Lisbon" },
"units": { "type": "string", "enum": ["metric", "imperial"] }
},
"required": ["city"]
},
"annotations": { "readOnlyHint": true }
}What makes a description work for tool selection
The model never sees your implementation. It picks a tool, and fills its arguments, from the name and the descriptions. The providers give consistent advice:
- Say when to use it and when not to. —Anthropic’s guidance: explain what the tool does, when it should and should not be used, and what it does not return, in at least three to four sentences. It calls this the most important factor in tool performance.
- Describe every parameter, with its format. —Google’s guide recommends examples and constraints in the parameter description itself, such as “The city and state, e.g. San Francisco, CA”. A parameter with no description is filled from its name alone.
- Use an enum instead of prose. —OpenAI and Google both say to list a fixed set of values in
enumrather than describing them in prose. - Apply the intern test. —OpenAI’s check: could a new colleague call the function correctly given only what the model gets? Whatever they would have to ask belongs in the description.
- Keep the list short. —OpenAI suggests fewer than 20 functions available at the start of a turn; Google suggests an active set of 10–20.
Errors caused by malformed tool schemas
Only messages the providers publish are quoted. OpenAI documents when a strict schema is rejected but not the message text, so that entry describes the condition.
Schema is too complex for compilation.
Cause: Anthropic, HTTP 400. Strict tools are compiled into a grammar and the combined schemas exceed its size limits. The documented hard limits are 20 strict tools, 24 optional parameters and 16 union-typed parameters per request.
Fix: Set strict only on the tools where a malformed call does real damage, make more parameters required, and flatten nested optional objects.
400 INVALID_ARGUMENT
Cause: Gemini. With function-calling mode ANY, or with complex schemas, the declarations are compiled into a state machine with limits on states, branching and nesting depth. Optional properties, large enums, anyOf branches and array bounds all add to it.
Fix: Split large tool sets, flatten nested objects, trim enums, and move formatting rules into the field description.
{ "code": -32602, "message": "Unknown tool: invalid_tool_name" }
Cause: MCP protocol error from tools/call when the server has no tool with that name. One route to it: the tool was renamed to fit a provider’s name pattern and the new name was forwarded to the server.
Fix: Keep the original MCP name alongside the provider-facing one and translate back before calling the server.
OpenAI: request rejected when "strict": true
Cause: The schema breaks one of the two strict-mode requirements: an object without additionalProperties: false, or a property not listed in required.
Fix: Add additionalProperties: false to every object, nested ones included, and list every property in required. Keep a field optional with a type such as ["string", "null"].
What cannot be converted, and how it is reported
A conversion is lossless only when both sides have a field for the same thing. The rest goes into the notes panel:
- MCP
titleandannotations(readOnlyHint,destructiveHint,idempotentHint,openWorldHint) have no provider-API counterpart. - Output schemas move between MCP
outputSchema, OpenAI Responsesoutput_schemaand Geminiresponse; Chat Completions and Anthropic tools have nowhere to put one. - Provider extras such as Anthropic’s
cache_controlandinput_examplesare listed by name as dropped. - Names are rewritten only for a target whose rule they break.
Checked against OpenAI’s function calling and structured outputs guides, Anthropic’s define tools and strict tool use pages, Google’s function calling guide, and the MCP tools specification. For real MCP definitions to try, CodeLint.Dev’s own server is documented at /agents.
About
Every LLM API wants the same thing from a tool definition (a name, a description and a JSON Schema for the arguments) and each one spells it differently. This converter reads a definition written for OpenAI Chat Completions, the OpenAI Responses API, Anthropic Messages, Gemini function declarations or MCP, and writes the equivalent for the other four. Where a target cannot carry something (an MCP annotation, a strict flag, a JSON Schema keyword outside Gemini’s subset, a name with a dot in it), the output stays valid and the conversion notes list exactly what was removed or rewritten. A linter then checks names, descriptions, required lists and strict-mode requirements against each provider’s documented rules. Parsing, conversion and linting all run in your browser.
How to use
- 1 Paste a tool definition into the left panel: a single tool, an array of tools, a Gemini { "functionDeclarations": [...] } wrapper, a request body with a tools array, or an MCP tools/list response.
- 2 Check the detected source format in the toolbar. If it is wrong (a bare { name, description, parameters } object is ambiguous), pick the format from the Source format menu.
- 3 Open a target tab on the right and read its conversion notes: “Dropped” means information that format cannot hold, “Changed” means it was rewritten, “Added” means the target needed a field the source did not have.
- 4 For Gemini, choose whether the schema goes into parameters (OpenAPI subset, unsupported keywords removed) or parametersJsonSchema (your JSON Schema unchanged).
- 5 Work through the lint report. Each finding names the formats it applies to, so you can ignore one that only affects an API you do not target.
- 6 Copy or download the converted JSON. If a name was rewritten for a target, keep a map from the new name back to the original for dispatching calls.
- Is strict mode an OpenAI-only feature?
- No. OpenAI function tools and Anthropic tools both accept strict: true, and the converter carries the flag between them. The requirements differ. OpenAI requires additionalProperties: false on every object and every property listed in required, with optional fields expressed by adding "null" to the type. Anthropic also requires additionalProperties: false but allows optional properties (up to 24 across all strict tools in a request) and rejects numeric and string-length constraints such as minimum or maxLength. Gemini function declarations and MCP tools have no per-tool strict flag, so it is reported as dropped there.
- Should the Gemini output use parameters or parametersJsonSchema?
- A FunctionDeclaration takes one or the other; they are mutually exclusive. parameters is a Schema object, a subset of OpenAPI 3.0 with no $ref, additionalProperties, oneOf or const, where null is expressed as nullable: true. parametersJsonSchema takes a JSON Schema object as it is. Use parameters if your code or SDK builds Schema objects; use parametersJsonSchema if you want the schema to arrive exactly as written for another provider.
- What happens to a tool name like admin.tools.list?
- Dots are valid in MCP tool names and in Gemini function names, but OpenAI and Anthropic allow only letters, digits, underscores and dashes (64 characters for OpenAI, 128 for Anthropic). For those targets the converter replaces each disallowed character with an underscore, truncates to the limit, and records the rename in the notes. The model will call the new name, so your dispatcher has to map it back before it forwards the call to the MCP server.
- Can I paste the result of an MCP tools/list request directly?
- Yes. The whole JSON-RPC response, the result object or just the tools array all work; the converter unwraps them and reads each entry as an MCP tool. That is the quickest way to turn an MCP server’s tools into function declarations for a provider API: for example, the tools/list response from CodeLint.Dev’s own MCP server at https://codelint.dev/mcp.
- How is a bare { name, description, parameters } object interpreted?
- As a Gemini function declaration. The same shape is also what OpenAI’s deprecated functions parameter used, so if that is where your definition came from the conversion is still correct. A flat object with type: "function" is read as an OpenAI Responses tool; Gemini’s newer Interactions API uses that same flat shape. Use the Source format menu when you need to force a reading.
- Why does the linter flag a description that the API would accept?
- Because the API accepting a definition and the model using it well are different things. Descriptions are optional in the OpenAI and MCP schemas, but the description is what the model reads when it decides whether to call a tool and how to fill the arguments. Anthropic’s documentation recommends at least three to four sentences per tool. Gemini is the one format where the reference marks description as required, which the linter reports as an error for that target.
More in AI Tools
See all ai tools.