Zenaique

Compare OpenAI function calling, Anthropic tool use, and ReAct free form text as agent tool invocation mechanisms

Short answer·Medium·4.0 · 0·~3 min·Asked atGoldman SachsLlamaIndexOpenAI·Relevant atAnthropic
Attempt it

Compare OpenAI function calling, Anthropic tool use (tool_use block), and ReAct free form text parsing as mechanisms for an LLM agent to invoke tools. For each, describe its reliability profile and key tradeoff.

Free · 2 AI evals / day
TL;DR

Native function calling emits trained-in structured JSON the provider validates; ReAct parses free-form text and is brittle; constrained decoding forces schema-valid output by construction.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine asking an assistant to fill out a form so a machine can read it. One way: hand them a printed form with labeled boxes, so they almost always write neatly in the right slots. That is native function calling. Another way: let them scribble the request in a sentence, then you squint and try to pull out the name and numbers yourself. That is free-form text parsing, and it breaks the moment they phrase it oddly. A third way: use a special pen that physically cannot write outside the boxes, so the form is always valid. That is constrained decoding. The first and third are reliable because the structure is built in. The middle one is flexible but fragile, because you are guessing at someone's handwriting every single time.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

Every agent loop has a moment where the model has to say which tool to run and with what arguments. Tool calling formats are the different mechanisms for expressing that intent so the runtime can act on it. They look superficially similar, but they differ in one decisive way: where the guarantee of well-formed output lives.

Three formats dominate. Native function calling, used by OpenAI and Anthropic, bakes the structure into the model and validates it at the provider. ReAct free-form text writes the action in prose and leaves parsing to your runtime. Constrained decoding forces validity at the token sampler so invalid output is impossible by construction. Understanding where each places the guarantee tells you exactly how each one fails.

The reason this matters so much is that a single malformed tool call can break an entire run. The agent loop is sequential, so a parse failure on turn three poisons every turn after it. The cheapest place to prevent that failure is as close to the model as possible, and that intuition is exactly what separates the three formats from one another.

Native function calling: structure trained into the model

With native calling you register each tool as a name plus a JSON schema for its arguments. The model was fine-tuned to emit that structure, so when it decides to act it produces a machine-readable call rather than prose. OpenAI returns a JSON arguments object attached to a function name. Anthropic returns a tool_use content block with the tool name and an input object. The two are conceptually identical but wire-format different. The training is the crucial part: because the format was reinforced during post-training, the model treats emitting a clean call as the natural thing to do, not an awkward constraint imposed at inference time.

The key property is that the provider enforces schema conformance before the call reaches you. Reliability is high because the output is parseable by construction, not by hope. You do not write a regex and you do not pray about formatting. The provider also handles the harder cases for you: parallel tool calls in one turn, well-typed arguments, and a clean separation between the model's prose and its structured action.

The tradeoff is coupling. The argument object and the tool_use block are vendor-specific, so a stack that targets more than one provider needs an adapter layer that translates tool definitions and tool results between formats. That adapter is small but it is real, and forgetting it is why naive multi-provider code breaks the day you swap models. The coupling extends to behaviour, not just shape: each provider has its own conventions for how a tool result is fed back, how errors are represented, and how multi-turn tool exchanges are sequenced, so the adapter has to normalise the whole round trip rather than just the request.

ReAct free-form text: structure parsed at runtime
Constrained decoding: structure forced at the sampler
Choosing in 2026 and why native plus validation won
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
MechanismWhere structure comes fromReliabilityKey tradeoff
Native function callingTrained-in plus provider schema checkHighProvider lock-in; vendor-specific schema formats
ReAct free-form textRuntime string parsingLower; drifts and hallucinatesFragile; needs robust parser and retries
Constrained decodingToken masking at the samplerHighest on format validityMore complex serving stack; some latency overhead

Real products, models, and research that use this idea.

  • Frontier models like GPT-5.5, Claude Opus 4.7, and Gemini 3.1 Pro all expose native tool calling with provider-side schema validation as the default invocation path in 2026.
  • Outlines and the vLLM guided-decoding backend run constrained decoding against a JSON schema or grammar to force schema-valid tool calls out of open weights like Llama 4 and DeepSeek V4.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow would you architect a single agent that runs across OpenAI, Anthropic, and a self-hosted open model?
A

Define tools once in a neutral schema, then write per-provider adapters that translate to the OpenAI arguments format, the Anthropic tool_use block, and a constrained-decoding grammar. Normalise results back to one internal type before the loop sees them.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Treating all three as equally reliable. Free-form text parsing fails on phrasing drift, while native calling and constrained decoding give machine-parseable output by construction.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Describe how native function calling produces structured output and who validates it.

  • Explain how the Anthropic tool_use block differs from the OpenAI arguments object.

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
What is the Model Context Protocol (MCP) and what problem does it solve?
MCQ·Easy