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.
Detailed answer & concept explanation~8 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define the three mechanisms, place each on the trained-in to runtime-parsed spectrum, give the reliability profile and tradeoff for each, then explain why the 2026 default is native calling plus a validation layer with constrained decoding for open weights.
| 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.
- LangGraph and the OpenAI Agents SDK wrap native function calling in a typed tool-node abstraction so the loop receives a validated argument object per turn.
- Early LangChain ReAct agents parsed free-form 'Action:' and 'Action Input:' lines with a regex, and the output parser exceptions they threw were a notorious source of failed runs.
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?
QNative calling gives schema-valid arguments. What failures can still slip through, and how do you catch them?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes 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.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.