Every major LLM API supports function calling and JSON output, but the parameter names, tool choice options, strictness guarantees and JSON Schema limits differ enough that code and schemas rarely move between providers unchanged. This page compares what six API providers document for tool use and structured output: how tools are declared, which tool_choice values exist, how parallel calls are controlled, whether tool arguments and final answers can be constrained to a schema, which schema keywords are enforced, and which tools run on the provider's own servers. It is written for developers porting an application between providers, platform teams building a multi-model gateway, and buyers checking whether a model can drive agents reliably. Providers are listed alphabetically (Anthropic, DeepSeek, Google, Mistral AI, OpenAI, xAI) and order is never a ranking. Security design for agent tools is covered on separate pages linked below and is not repeated here.
Last checked: 2026-11-15.
This is an independent reference page from NHI Mgmt Group based on public provider documentation; it is not sponsored or endorsed by any provider. Parameters and schema support change often, so confirm details on each provider's current pages, linked in the sources list.
Key takeaways
- The tool declaration shape is broadly shared. All six providers describe tools as a name, a description and a JSON Schema for parameters; DeepSeek, Mistral AI and xAI use the OpenAI-style
{"type": "function"}wrapper, and Anthropic usesinput_schemaon each tool. - Tool choice vocabularies differ. "Must call a tool" is
anyfor Anthropic, Google and Mistral AI andrequiredfor OpenAI and xAI; Google adds avalidatedmode, and Google and OpenAI support anallowed_toolssubset. - Schema-constrained output is documented by five of six providers. Anthropic, Google, OpenAI and xAI document a JSON Schema response format, Mistral AI documents custom structured outputs, and DeepSeek documents JSON Output (
json_object) plus a Beta strict mode for tool arguments. - Strict mode has rules. Anthropic, DeepSeek and OpenAI require
additionalProperties: falsein strict schemas, OpenAI and DeepSeek require every property inrequired, and xAI treats tool arguments as strict implicitly. - Every provider supports only a subset of JSON Schema. Unsupported keywords are rejected, stripped or treated as best-effort depending on the provider, so applications should still validate output against business rules.
What are tool use and structured output?
Tool use (also called function calling) lets a model return a request to call a named function with arguments; the application runs it and sends the result back. Structured output constrains the model's own reply to a schema so that it can be parsed without repair. The two often appear together: a strict tool schema governs the call arguments, and a response format governs the final answer. Three levels of guarantee appear in provider documentation:
- JSON mode: output is valid JSON, but not necessarily in your shape (OpenAI and xAI
json_object, DeepSeek JSON Output, Mistral AI JSON mode). - Schema-constrained output: output follows your JSON Schema for supported keywords, typically through constrained decoding.
- Strict tool arguments: tool call arguments follow the tool's schema.
For when a schema is the right control for agent actions, see Structured Outputs vs Free Text for Agent Actions; for how native function calling relates to MCP, see MCP vs Native Function Calling.
The six providers at a glance
As of 2026-11-15. Sources: each provider's tool use, function calling and structured output documentation, linked in Standards and references.
| Provider | tool_choice values | Parallel calls | Strict tool arguments | Schema response format | JSON mode |
|---|---|---|---|---|---|
| Anthropic | auto (default), any, tool, none | Supported; disable_parallel_tool_use: true inside tool_choice limits to one | strict: true per tool | output_config.format with type: "json_schema" | Not stated by Anthropic as a separate mode |
| DeepSeek | Not stated by DeepSeek on the pages checked | Not stated by DeepSeek on the pages checked | Beta: strict: true on every function, with base_url https://api.deepseek.com/beta | Not stated by DeepSeek on the pages checked | response_format: {"type": "json_object"} |
| Google (Gemini API) | auto (default), any, none, validated; allowed_tools | Supported (parallel and compositional) | validated mode ensures function schema adherence | response_format with mime_type: "application/json" and schema | Not stated by Google as a separate mode |
| Mistral AI | auto (default), any, none | parallel_tool_calls, default true | Not stated by Mistral AI on the pages checked | Custom structured outputs with your own schema | JSON mode; the prompt must ask for JSON |
| OpenAI | auto (default), required, none, forced function, allowed_tools | parallel_tool_calls; false means zero or one call | strict: true; Responses API normalises to strict by default where possible | text.format (Responses) or response_format (Chat Completions) with json_schema and strict: true | json_object |
| xAI | auto (default), required, none, forced function | Enabled by default; parallel_tool_calls: false disables | Implicitly always strict for tool arguments | response_format with type: "json_schema" | json_object |
How each provider documents tool use
Anthropic
Anthropic separates client tools, which run in the application (user-defined tools plus Anthropic-schema tools such as bash, text editor, memory, computer use and browser use), from server tools that Anthropic runs (web search, web fetch, code execution, advisor, tool search and the MCP connector). A tool call ends the turn with stop_reason: "tool_use" and the application returns a tool_result. Passing tools adds a system prompt whose size Anthropic publishes per model: for Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5 it is 286 tokens with auto or none and 406 with any or tool. No maximum tool count is stated; Anthropic describes the tool search tool for working with thousands of tools. See Anthropic Models.
DeepSeek
DeepSeek uses the OpenAI-compatible Chat Completions format: tools with type: "function", calls returned in message.tool_calls, and results sent back with role: "tool" and the matching tool_call_id. Tool use works in thinking mode from DeepSeek-V3.2 onwards. The pricing page lists Tool Calls and JSON Output for both deepseek-flash and deepseek-v4-pro, and also lists Responses API and Anthropic API compatibility; the Anthropic and Responses APIs support inserting tool call messages mid-conversation, while Chat Completions does not. Server-side web search and web fetch are priced at $0.75 per 1,000 uses. See DeepSeek Models.
The Gemini API declares functions with type, name, description and parameters, and sets the mode in generation_config.tool_choice. Google documents parallel calls for independent functions and compositional calls chained across turns. The model does not execute functions; the application runs them and returns a function_result, which on Gemini 3 series models can include images, documents, audio and video. Gemini 4 and Gemini 3 models can combine built-in tools such as google_search with custom functions. No maximum declaration count is stated on the page checked. See Google Gemini Models.
Mistral AI
Mistral AI declares tools with type: "function" and a function block of name, description and JSON Schema parameters. tool_choice takes auto, any or none, and parallel_tool_calls defaults to true. The function calling page lists capable models including mistral-large-latest, mistral-medium-latest, mistral-small-latest, the Ministral, Devstral and Codestral models and the Magistral reasoning models, as a non-exhaustive list. Server-side tools are documented for the Agents and Conversations API. See Mistral AI Models.
OpenAI
OpenAI defines functions with type, name, description, parameters and strict, and also supports custom tools with free-form text input, tool namespaces and defer_loading with tool search (from gpt-5.4). GPT-6 Astra and GPT-6.1 Sol require the Responses API for tool calling. OpenAI gives no hard maximum but suggests fewer than 20 functions available at the start of a turn as a soft guide, and function definitions count as input tokens. Built-in tools named in the guide include web search, code interpreter and remote MCP servers, with file search, shell, computer use, apply patch and image generation in the documentation set. Built-in tools cannot be included in a parallel function-call batch. See OpenAI Models.
xAI
xAI declares tools with type: "function", name, description and a parameters schema whose root must be an object; a scalar, array or mixed union root returns a 400 error naming the tool. Up to 350 tools are allowed per request. Built-in web_search and x_search run server-side, while custom tools pause execution and return to the application. With streaming, a function call arrives in full in a single chunk. Structured outputs with tools are available for supported Grok 4 family models. See xAI Models.
Structured output and JSON Schema support
As of 2026-11-15. Only keywords and limits stated on each provider's page are listed.
| Provider | Schema requirements | Stated limits or unsupported keywords | Behaviour on invalid or unsupported schema |
|---|---|---|---|
| Anthropic | additionalProperties: false on objects; required properties output first | Per request: 20 strict tools, 24 optional parameters, 16 union-type parameters; constraints such as minimum and maxLength moved into descriptions by SDK helpers | 400 "Schema is too complex for compilation"; 180-second compilation timeout |
| DeepSeek (strict Beta) | All properties required; additionalProperties: false | Supports object, string, number, integer, boolean, array, enum, anyOf, $ref; minLength, maxLength, minItems, maxItems not supported | Server returns an error for non-conforming schemas |
| Subset of JSON Schema; nullable via type array | minLength, maxLength, minProperties, maxProperties, uniqueItems, contains ignored; minItems and maxItems enforced; minimum and maximum listed as supported | Ignored keywords stripped; very large or deeply nested schemas return 400 INVALID_ARGUMENT | |
| Mistral AI | Custom schema; JSON mode needs the prompt to request JSON and the format | Not stated by Mistral AI on the pages checked | Not stated by Mistral AI on the pages checked |
| OpenAI | additionalProperties: false; all fields in required; optional fields via a null type | Some JSON Schema features unsupported (listed in OpenAI's supported schemas section) | With strict: true a non-conforming schema is rejected; Responses falls back to non-strict when normalisation fails |
| xAI | additionalProperties defaults to false | minLength/maxLength up to 2,048, minItems/maxItems up to 256, minProperties/maxProperties up to 64; not and if/then/else best-effort | 400 for zero-variant enums, boolean property schemas and array-form items |
Refusals and incomplete output
A schema does not stop a model from refusing or running out of tokens. Anthropic returns stop_reason: "refusal" (billed, may not match the schema) or max_tokens; OpenAI exposes refusals programmatically through a refusal field and response status; DeepSeek may return content of only spaces when output cannot be recognised as JSON and advises handling blank content and setting max_tokens high enough. Anthropic also notes enum casing can differ and that structured outputs are incompatible with citations and message prefilling.
Latency and caching effects
Constrained decoding has a set-up cost. Anthropic states the first request with a new schema has extra latency while a grammar compiles, and that compiled grammars are cached for 24 hours from last use; changing schema structure or the tool set invalidates the cache. OpenAI notes schemas for fine-tuned models are processed and cached on first use, which can add latency and makes those cached schemas ineligible for zero data retention. Speed tiers are compared on LLM Speed and Latency Compared.
Built-in server tools
| Provider | Server-run tools named in the pages checked |
|---|---|
| Anthropic | Web search, web fetch, code execution, advisor, tool search, MCP connector |
| DeepSeek | Web search and web fetch (priced per 1,000 uses), file parsing and OCR |
google_search, url_context, code execution, File Search | |
| Mistral AI | Server-side tools for the Agents and Conversations API |
| OpenAI | Web search, code interpreter, remote MCP servers, file search, shell, computer use, apply patch, image generation |
| xAI | web_search, x_search, code execution, with collections search and remote MCP in the documentation set |
Server tools run with the provider's infrastructure and your account's permissions, so connector and MCP scopes need the same review as any integration; see the AI Agent Tool and Plugin Security Guide.
Porting between providers
- Normalise declarations: keep one internal tool definition (name, description, JSON Schema) and generate each provider's wrapper, since Anthropic uses
input_schemaand the others useparameters. - Write schemas to the strictest common subset: objects with
additionalProperties: false, every property required with nullable types for optional values, no reliance on length or uniqueness keywords that Google ignores and DeepSeek strict mode does not support. - Map tool choice values: translate "must call" to
anyorrequiredper provider, and test whether forced-tool and allowed-subset options exist before relying on them. - Handle parallel calls everywhere: parallel calls are on by default for Mistral AI, OpenAI and xAI; process every call in a response and return all results before the next model turn.
- Validate after parsing: check business rules, ranges and enums in code, and treat refusals, truncated output and blank content as handled errors with a retry path.
- Test per model, not per provider: support lists differ by model and API surface (for example, OpenAI requires the Responses API for tool calling on GPT-6 Astra and GPT-6.1 Sol).
How to choose: factual criteria
These are criteria to test, not recommendations.
| Criterion | Facts to check |
|---|---|
| Guarantee needed | Whether you need valid JSON only, schema-constrained output, strict tool arguments or all three, and which the target model documents |
| Schema complexity | Stated limits such as Anthropic's 20 strict tools per request and xAI's 64 properties bound; large catalogues may need tool search (Anthropic, OpenAI) |
| Tool count | xAI's 350-tool maximum, OpenAI's soft guide of fewer than 20 functions at turn start, and the token overhead of declarations |
| Server tools | Which search, fetch, code and MCP tools run server-side and how each is billed |
| API surface | Chat Completions compatibility (DeepSeek, Mistral AI, xAI), Responses API requirements (OpenAI) and Anthropic API compatibility (DeepSeek) |
| Feature status | Beta or preview labels, such as DeepSeek strict mode (Beta) and Google structured output with tools (preview) |
A small team on one provider can use that provider's SDK helpers (Pydantic or Zod parsing is documented by Anthropic, Google, OpenAI and xAI). A larger organisation running several models behind a gateway benefits from the porting steps above and contract tests per model.
Where identity fits
A tool call is an action taken with the credentials the application holds. Strict schemas constrain argument shape but not authority, so scope each tool's credentials to the minimum it needs and log every call with the agent and user it ran for. See Least Privilege for AI Agent Tool Use.
Practitioner checklist
- Record, per model in use, the tool choice values, parallel default, strict mode and response format it documents.
- Write tool and response schemas to a common strict subset and keep one internal definition per tool.
- Turn on strict tool arguments where the provider documents them, and confirm Beta or preview status before production use.
- Validate every parsed output in code and handle refusals, truncation and blank content with a retry path.
- Process all parallel tool calls in a response before returning results.
- Measure first-request latency for new schemas and keep schemas stable to benefit from grammar caching.
- Review which server tools and MCP connectors are enabled and who approved them.
- Re-check provider documentation when changing model versions, since support lists differ per model.
Standards and references
- Anthropic: Tool use overview (accessed 2026-11-15)
- Anthropic: Structured outputs (accessed 2026-11-15)
- DeepSeek: Tool calls (accessed 2026-11-15)
- DeepSeek: JSON Output (accessed 2026-11-15)
- Google: Gemini API function calling (accessed 2026-11-15)
- Google: Gemini API structured output (accessed 2026-11-15)
- Mistral AI: Function calling (accessed 2026-11-15)
- Mistral AI: Structured outputs (accessed 2026-11-15)
- OpenAI: Function calling (accessed 2026-11-15)
- OpenAI: Structured outputs (accessed 2026-11-15)
- xAI: Function calling (accessed 2026-11-15)
- xAI: Structured outputs (accessed 2026-11-15)
Related NHI Mgmt Group resources: Frontier AI Models Compared, MCP vs Native Function Calling, Structured Outputs vs Free Text for Agent Actions, LLM Speed and Latency Compared.