mysi Find

Brief in AI engineering

LLM tool calling formats

Field names, shapes and limits for tool definitions and tool calls in the Anthropic, OpenAI and Gemini APIs.

Anthropic nests the schema as input_schema and returns tool_use content blocks. OpenAI Responses uses flat function tools and function_call items with a JSON string of arguments. Gemini has two shapes: generateContent parts (functionCall, functionResponse) and Interactions API steps (function_call, function_result).

Facts

Item Anthropic Messages OpenAI Gemini generateContent
Tool name limit regex ^[a-zA-Z0-9_-]{1,128}$ [1] Chat Completions: a-z, A-Z, 0-9, underscores and dashes; at most 64 characters [6] Function declaration: a-z, A-Z, 0-9, underscores, colons, dots and dashes; at most 128 characters [8]
Result sent back tool_result block in a user message with tool_use_id, optional content, optional is_error [2] Responses: input item {type: "function_call_output", call_id, output} [5] functionResponse part with name, response object and the matching id [8]
Choice modes tool_choice type auto, any, tool or none [1] Responses: tool_choice "auto", "required", "none", {type: "function", name} or allowed_tools [5] functionCallingConfig.mode AUTO, ANY, NONE or VALIDATED [8]
  • Anthropic: tool_choice auto is the default when tools are given [1].
  • Anthropic: tool_choice none is the default when no tools are given [1].
  • Anthropic: tool_choice any or tool returns a 400 error on Claude Fable 5.2, Claude Mythos 5.2, Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5.1 and Claude Mythos 5.1 [1].
  • Anthropic: disable_parallel_tool_use: true goes inside the tool_choice object; it is not a top-level parameter [3].
  • Anthropic: with tool_choice auto, disable_parallel_tool_use: true means at most one tool call per response [3].
  • Anthropic: with tool_choice any or tool, disable_parallel_tool_use: true means exactly one tool call [3].
  • Anthropic: strict: true on a tool uses grammar-constrained sampling [4].
  • Anthropic: the compiled strict schema is cached for up to 24 hours since last use [4].
  • OpenAI Responses: when strict is omitted, it tries to make the schema strict and falls back to non-strict [5].
  • OpenAI Chat Completions: function calling is non-strict by default [5].
  • OpenAI: built-in tools cannot be in a parallel function-call batch [5].
  • OpenAI Chat Completions: parallel_tool_calls defaults to true [6].
  • Gemini: VALIDATED mode lets the model answer in text or call a function [8].
  • Gemini: VALIDATED mode validates function calls with constrained decoding [8].
  • Gemini: allowedFunctionNames should only be set when the mode is ANY or VALIDATED [8].
  • Gemini: the function calling guide uses the Interactions API at v1beta/interactions [7].
  • Gemini Interactions API: a tool is flat: {type: "function", name, description, parameters} [7].
  • Gemini Interactions API: a call comes back as a function_call step with an id [7].
  • Gemini Interactions API: a result goes back as a function_result step whose call_id is that id [7].
  • Gemini Interactions API: the mode is tool_choice in generation_config: auto (default), any, none or validated [7].

Use it for

  • Translating one tool definition and one call/result loop between the three APIs.
  • Checking tool names against each vendor's character set and length limit.
  • Choosing how to force, forbid or serialize tool calls per vendor and model.
  • It does not cover token cost of tool definitions, server-side tools, or JSON Schema subsets.

Sources

Tested

Tested 4 Dec 2026: claude-haiku-5-5 stated 3 of its 23 facts without this page and 22 with it; claude-fable-5-2 stated 2 of its 23 facts without this page and 23 with it.

Changes

Cite as: mysi, LLM tool calling formats, mysi.dev/llm-tool-calling-formats, version 1, changed 2026-12-04. Text and data CC BY 4.0.