Compare OpenAI function calling, Anthropic tool use, and ReAct free form text as agent tool invocation mechanisms
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.
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.
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.
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.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
| Mechanism | Where structure comes from | Reliability | Key tradeoff |
|---|---|---|---|
| Native function calling | Trained-in plus provider schema check | High | Provider lock-in; vendor-specific schema formats |
| ReAct free-form text | Runtime string parsing | Lower; drifts and hallucinates | Fragile; needs robust parser and retries |
| Constrained decoding | Token masking at the sampler | Highest on format validity | More 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.
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?
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.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
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.
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.
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.