Developer and Text Tools

Designing Tool Schemas for LLM Function Calling Without the Guesswork

How to define tools for OpenAI, Claude and Gemini function calling: good names and descriptions, parameter schemas, strict mode and testing arguments.

Saizul Amin
Saizul Amin3 Nov 2026 · 4 min read
Designing Tool Schemas for LLM Function Calling Without the Guesswork

Function calling turns a language model from a chat partner into something that can act. You describe the tools your application offers, the model decides when one is needed, and it replies with arguments that your code uses to run the function. The quality of that loop depends heavily on how well the tools are described. Vague descriptions lead to the wrong tool being picked; loose schemas lead to arguments your code cannot use. This guide covers how to design tool definitions that work, and how to keep them portable between providers.

The anatomy of a tool

Every major provider asks for the same three things. A name, which must be short and use only letters, digits, underscores and hyphens. A description, which the model reads to decide when the tool applies. And a parameters schema written in JSON Schema, which tells the model what arguments to send and in what shape.

The envelope around these three differs. OpenAI wraps each tool as a function inside a list, with slightly different shapes for the Chat Completions and Responses APIs. Anthropic uses an input_schema field. Gemini wants function declarations and an OpenAPI-style schema with upper-case type names. MCP servers publish an inputSchema in their tool listing. Writing all of these by hand invites small inconsistencies.

Writing descriptions that help the model

Treat the description as instructions to a new colleague. Say what the tool does, when to use it, and when not to. For example: get the current weather for a city; use when the user asks about weather, temperature or rain. For tools with side effects, add the condition explicitly: call only after the customer confirms the items. Each parameter deserves a description too, ideally with an example value. Models fill arguments far more reliably when they know that city means a city name like Dhaka or London rather than coordinates.

Building the parameters

Open the Function Calling and Tool Schema Builder. Two example tools are loaded: a simple weather lookup and an order tool with a list of items. Add a tool, name it, describe it, then add fields. Each field has a type, a description and a required switch. Strings can carry a format such as date or email, a pattern or length limits; numbers can have a range; enums list allowed values one per line. Choose array to build a list, and object for nested structures; an array of objects is how you model line items, recipients or filters.

The checks panel watches as you type. It catches invalid tool names, duplicates, missing descriptions, enums without values, broken regular expressions and impossible ranges. These are exactly the mistakes that otherwise surface as confusing API errors or odd model behaviour.

Strict mode

OpenAI offers a strict mode that guarantees the arguments match the schema exactly. It comes with rules: every object must forbid extra properties, every property must be listed as required, and optional values must be expressed by allowing null. The builder writes strict schemas this way automatically when the switch is on, and the checks panel confirms the result follows the rules. For other providers the same tool exports without the strict-only adjustments.

Exporting and converting

On the export tab, choose a format and copy or download the result. Switch formats to get the same tools for another provider; nothing needs to be rewritten. TypeScript interfaces for each tool's arguments are generated alongside, so the code that handles a tool call can be typed from the same source.

The import tab works in the other direction. Paste tool definitions from an existing codebase, an API log or documentation in any of the supported formats, edit them in the form, then export them wherever you need. This makes the builder a practical converter when you move a feature between providers or support several at once.

Testing real arguments

Models occasionally produce arguments that do not fit, especially without strict mode. Paste what a model returned on the test tab, code fences and all. The validator lists type mismatches, missing required fields, values outside enums or ranges, pattern failures and unexpected properties, each with a path such as items, first entry, quantity. Use the fill button to generate a valid example argument object as a reference.

Keep tool lists small

Every tool definition is sent with every request and costs tokens. Large lists also make the right choice harder for the model. Group related actions, remove tools a conversation does not need, and keep descriptions precise rather than long.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages