# LLM tool calling formats 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 1. Define tools, Anthropic. https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools.md. Read 4 Dec 2026. 2. Handle tool calls, Anthropic. https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls.md. Read 4 Dec 2026. 3. Parallel tool use, Anthropic. https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use.md. Read 4 Dec 2026. 4. Strict tool use, Anthropic. https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use.md. Read 4 Dec 2026. 5. Function calling, OpenAI. https://developers.openai.com/api/docs/guides/function-calling.md. Read 4 Dec 2026. 6. Create chat completion, OpenAI. https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create. Read 4 Dec 2026. 7. Function calling with the Gemini API, Google. https://ai.google.dev/gemini-api/docs/function-calling.md.txt. Read 4 Dec 2026. 8. Gemini API reference, Tool and FunctionCallingConfig, Google. https://ai.google.dev/api/caching. Read 4 Dec 2026. Cite as: mysi, LLM tool calling formats, mysi.dev/llm-tool-calling-formats, version 1, changed 2026-12-04. Text CC BY 4.0.