Tool schema (JSON Schema)
Updated November 24, 2026
A tool schema is the JSON Schema in a tool definition that declares a tool's arguments, their types, which ones are required and which values are allowed. A model reads it to build a valid call, and the client or server uses it to validate the arguments before the tool runs. Some tools also publish a schema for their output.
In short: A tool schema is a JSON Schema object, such as the MCP inputSchema, that defines a tool's arguments, types and required fields so models can build valid calls and code can validate them.
How a tool schema works
A tool schema is ordinary JSON Schema, a declarative language for defining the structure and constraints of JSON data 1. The schema itself is written in JSON, and a JSON Schema validator checks whether a given document conforms to it 1.
In a tool calling setup, the schema sits next to the tool's name and description. MCP calls it inputSchema and requires a valid JSON Schema object, never null 2. When the schema has no $schema field it defaults to the 2020-12 dialect, and a tool can declare another dialect, such as draft-07, explicitly 2.
The model reads the schema to build the arguments object. OpenAI's function calling guide notes that, because parameters are defined by a JSON schema, a tool can use property types, enums, descriptions, nested objects and recursive objects 3. The client then sends those arguments in a tools/call request, as in the MCP example that passes a location string to get_weather 2.
Validation happens on both sides. An MCP server must validate all tool inputs, and clients should follow the specification's $ref resolution rules when they validate inputs and outputs against inputSchema and outputSchema 2. Input that fails validation, such as a date in the wrong format, should come back as a tool execution error with isError set to true, which gives the model feedback it can use to correct the call 2.
A tool can also publish an outputSchema. If it does, the server must return structured results that conform to it, and clients should validate those results against it 2. For a tool with no parameters, the specification recommends an object schema with additionalProperties set to false, which accepts only an empty object 2.
The current MCP revision gives the schema one more job. A property can carry an x-mcp-header annotation, which mirrors its value into an Mcp-Param header on the Streamable HTTP transport so load balancers and proxies can route on it without parsing the request body 2. The annotation applies only to string, integer and boolean parameters, and servers should not use it for passwords, API keys, tokens or personal data, because network intermediaries can see header values 2.
Strict schemas and what they require
A schema guides the model, but without strict mode the call is best effort. OpenAI's strict mode makes function calls reliably follow the schema instead, and OpenAI recommends always enabling it 3. Strict mode sets rules for the schema itself 3.
No extra keys. additionalProperties must be set to false for each object in the parameters 3.
Every field required. All fields in properties must be marked as required, and an optional field is written by adding null as a type option 3.
Errors on mismatch. A request with strict set to true and a schema that breaks these rules is rejected with details about the missing constraints 3.
Different defaults. The Responses API tries to normalize a schema into strict mode and falls back to best-effort calling if it cannot, while Chat Completions requests stay non-strict by default 3.
OpenAI says strict mode is built on its structured outputs feature, which is why the rules look like that feature's rules 3. A schema that a general JSON Schema validator accepts can still be rejected here, for example an object that leaves additionalProperties open. Teams that share one schema across several model APIs should test it against each before relying on it.
MCP sets controls around the schema as well. The specification tells servers to rate limit tool invocations and sanitize tool outputs, and tells clients to implement timeouts for tool calls and log tool usage for audit 2. A valid schema is one control among several.
Example of a tool schema
A GTM engineer gives an agent a RichAPI email lookup through LangChain. RichAPI's guide defines each endpoint as a @tool function with a Pydantic args_schema, so the model fills typed fields instead of guessing JSON 4.
Written as an MCP tool definition, the schema the model reads looks like this.
{"name": "find_work_email",
"description": "Find a verified work email.",
"inputSchema": {
"type": "object",
"properties": {
"full_name": {"type": "string", "description": "Person's full name"},
"company_domain": {"type": "string",
"description": "Bare domain such as acme.com, no scheme or www"}},
"required": ["full_name", "company_domain"],
"additionalProperties": false}}The required list stops the model from calling with a name alone. Setting additionalProperties to false rules out invented arguments the endpoint does not take.
The schema cannot catch everything. A string field accepts https://www.acme.com/about as readily as acme.com, so the format rule lives in the tool description, and the guide calls that sentence load-bearing 4. A malformed domain costs nothing on email_finder, because the waterfall soft-fails free, but on enrich_profile, which bills on any 2xx, it costs a credit 4.
The guide applies the same idea to the output. It parses each response with a Pydantic output model, so a miss becomes a typed None rather than a string the next step has to interpret 4. Waterfall endpoints return HTTP 200 with success false and billed false when nothing is found, so the output model carries a found flag next to the email 4. A step that merges results into a CRM can then branch on found, and a miss never lands in a merge field as the word None.
Tool schema vs tool description
Both sit in the same tool definition, and the model reads both before it calls 2. The schema is the contract that code can check, and the description is the prose that explains intent.
| Tool schema | Tool description | |
|---|---|---|
| What it answers | Which arguments are valid? | What is the tool for? |
| Input | Types, required fields, enums, nesting | Purpose, formats, output meaning |
| Output | Arguments that validate, or an error | A better tool choice and better arguments |
| Cost driver | Failed or wasted calls when it is loose | Input tokens on every request |
| Main risk | Valid JSON with a wrong value | Vague text the model misreads |
| Use it when | A rule can be checked by code | A rule needs judgment or context |
Frequently asked questions
What is a tool schema?
A tool schema is the JSON Schema that defines a tool's arguments, including their types, required fields and allowed values. In MCP it is the inputSchema field, which must be a valid JSON Schema object and defaults to the 2020-12 dialect 2. Models read it to build calls, and code uses it to validate them.
Which JSON Schema version does MCP use?
MCP tool schemas default to JSON Schema 2020-12 when no $schema field is present 2. A tool can declare a different dialect, such as draft-07, by setting $schema explicitly, and the specification shows an example of each 2. Keeping to the default avoids dialect mismatches between clients.
What is an output schema?
An output schema is an optional JSON Schema that describes a tool's structured result 2. If a tool provides one, the server must return structured results that conform to it, and clients should validate them against it 2. It tells clients and models how to parse the returned data.
Why does strict mode make every field required?
OpenAI's strict mode is built on its structured outputs feature, which needs additionalProperties set to false and every field in properties marked as required 3. To keep a field optional, add null as an allowed type, so the model sends an explicit null instead of leaving the field out 3.
The bottom line
A tool schema is the JSON Schema contract for a tool's arguments, read by the model to build calls and by code to validate them 2. Mark required fields, use enums for fixed choices and close objects with additionalProperties set to false. Put rules a schema cannot check, such as a bare-domain format, in the description, and test the schema against the strict mode of each model API in use 3.
Sources
- What is JSON Schema?, JSON Schema
- Tools (specification, version 2026-07-28), Model Context Protocol
- Function calling, OpenAI
- LangChain integration guide, RichAPI