Join our Newsletter — 33% off our NHI Course
Home› Guides› LLM Tool Use, Function Calling and Structured Output…
Guide AI Platforms

LLM Tool Use, Function Calling and Structured Output Support Compared: Parameters, Limits and Schema Rules by Provider

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 15 November 2026 13 min read
On this page

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 uses input_schema on each tool.
  • Tool choice vocabularies differ. "Must call a tool" is any for Anthropic, Google and Mistral AI and required for OpenAI and xAI; Google adds a validated mode, and Google and OpenAI support an allowed_tools subset.
  • 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: false in strict schemas, OpenAI and DeepSeek require every property in required, 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.

Providertool_choice valuesParallel callsStrict tool argumentsSchema response formatJSON mode
Anthropicauto (default), any, tool, noneSupported; disable_parallel_tool_use: true inside tool_choice limits to onestrict: true per tooloutput_config.format with type: "json_schema"Not stated by Anthropic as a separate mode
DeepSeekNot stated by DeepSeek on the pages checkedNot stated by DeepSeek on the pages checkedBeta: strict: true on every function, with base_url https://api.deepseek.com/betaNot stated by DeepSeek on the pages checkedresponse_format: {"type": "json_object"}
Google (Gemini API)auto (default), any, none, validated; allowed_toolsSupported (parallel and compositional)validated mode ensures function schema adherenceresponse_format with mime_type: "application/json" and schemaNot stated by Google as a separate mode
Mistral AIauto (default), any, noneparallel_tool_calls, default trueNot stated by Mistral AI on the pages checkedCustom structured outputs with your own schemaJSON mode; the prompt must ask for JSON
OpenAIauto (default), required, none, forced function, allowed_toolsparallel_tool_calls; false means zero or one callstrict: true; Responses API normalises to strict by default where possibletext.format (Responses) or response_format (Chat Completions) with json_schema and strict: truejson_object
xAIauto (default), required, none, forced functionEnabled by default; parallel_tool_calls: false disablesImplicitly always strict for tool argumentsresponse_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.

Google

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.

ProviderSchema requirementsStated limits or unsupported keywordsBehaviour on invalid or unsupported schema
AnthropicadditionalProperties: false on objects; required properties output firstPer request: 20 strict tools, 24 optional parameters, 16 union-type parameters; constraints such as minimum and maxLength moved into descriptions by SDK helpers400 "Schema is too complex for compilation"; 180-second compilation timeout
DeepSeek (strict Beta)All properties required; additionalProperties: falseSupports object, string, number, integer, boolean, array, enum, anyOf, $ref; minLength, maxLength, minItems, maxItems not supportedServer returns an error for non-conforming schemas
GoogleSubset of JSON Schema; nullable via type arrayminLength, maxLength, minProperties, maxProperties, uniqueItems, contains ignored; minItems and maxItems enforced; minimum and maximum listed as supportedIgnored keywords stripped; very large or deeply nested schemas return 400 INVALID_ARGUMENT
Mistral AICustom schema; JSON mode needs the prompt to request JSON and the formatNot stated by Mistral AI on the pages checkedNot stated by Mistral AI on the pages checked
OpenAIadditionalProperties: false; all fields in required; optional fields via a null typeSome 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
xAIadditionalProperties defaults to falseminLength/maxLength up to 2,048, minItems/maxItems up to 256, minProperties/maxProperties up to 64; not and if/then/else best-effort400 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

ProviderServer-run tools named in the pages checked
AnthropicWeb search, web fetch, code execution, advisor, tool search, MCP connector
DeepSeekWeb search and web fetch (priced per 1,000 uses), file parsing and OCR
Googlegoogle_search, url_context, code execution, File Search
Mistral AIServer-side tools for the Agents and Conversations API
OpenAIWeb search, code interpreter, remote MCP servers, file search, shell, computer use, apply patch, image generation
xAIweb_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

  1. Normalise declarations: keep one internal tool definition (name, description, JSON Schema) and generate each provider's wrapper, since Anthropic uses input_schema and the others use parameters.
  2. 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.
  3. Map tool choice values: translate "must call" to any or required per provider, and test whether forced-tool and allowed-subset options exist before relying on them.
  4. 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.
  5. 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.
  6. 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.

CriterionFacts to check
Guarantee neededWhether you need valid JSON only, schema-constrained output, strict tool arguments or all three, and which the target model documents
Schema complexityStated 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 countxAI's 350-tool maximum, OpenAI's soft guide of fewer than 20 functions at turn start, and the token overhead of declarations
Server toolsWhich search, fetch, code and MCP tools run server-side and how each is billed
API surfaceChat Completions compatibility (DeepSeek, Mistral AI, xAI), Responses API requirements (OpenAI) and Anthropic API compatibility (DeepSeek)
Feature statusBeta 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

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.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 15 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.