Topic 4 of 5 · 6 min read
Handoffs versus agents called as tools
Goal: Map an orchestrator-worker design onto an agent SDK and choose between a handoff and an agent-as-tool call for each worker.
A handoff passes control of the conversation to another agent; an agent used as a tool is called, returns a result, and leaves the caller in control. Orchestrator-worker designs use the second style. Triage and routing designs often use the first.
Check yourself · 1 of 3
What is the key difference between a handoff and an agent used as a tool?
Why it matters
The choice decides who talks to the user, who sees the full history and who writes the final answer. If you hand off to a worker, the lead is gone: it cannot merge three reports because it is no longer running. If you call workers as tools, the lead stays in charge and can check, retry and combine.
The two styles
- Handoff. The current agent transfers the conversation. The new agent usually sees the earlier messages (you can filter them) and answers the user directly. Good for a support desk that routes a billing question to a billing agent.
- Agent as tool. The lead calls the worker like a function with an input string. The worker runs with its own prompt and tools, and its final output comes back as the tool result. The lead continues. Good for orchestrator-worker work, where the lead needs several results.
Frameworks use different names. The OpenAI Agents SDK has handoffs and agent.as_tool(). The Claude Agent SDK defines subagents the lead calls through a task tool, and each runs in its own context. LangChain describes subagents and handoffs as separate patterns. The ideas match even where the names differ.
How to choose per worker
- Does the lead need this result to continue, or to combine with others? Use a tool call.
- Should the user now talk to a specialist for the rest of the chat? Use a handoff.
- Must several workers run at once? Use tool calls; one handoff moves control to one agent.
- Do you need a clean worker context with only the brief? Use a tool call, which passes just the input you give it.
Before and after
A lead set up with handoffs only:
lead = Agent(name="lead", handoffs=[pricing_agent, features_agent])
The lead hands the chat to pricing_agent and never sees features_agent's result. The fix, for a comparison that needs both:
lead = Agent(
name="lead",
instructions="Call both tools, then merge. Mark any unverified claim.",
tools=[
pricing_agent.as_tool(tool_name="research_pricing", tool_description="Find list prices"),
features_agent.as_tool(tool_name="research_features", tool_description="Compare features"),
],
)
What goes wrong
- Using a handoff for a worker. The lead cannot merge or check anything after the transfer.
- Tool descriptions left vague. The lead picks the wrong worker because both descriptions say "research".
- Passing full history to every worker. Each one pays to re-read context it does not need.
Examples
Support desk
A front-line agent reads "I was charged twice" and hands off to billing_agent. The billing agent talks to the customer from then on. No merging is needed, so a handoff fits.
Pull request review
A lead receives a diff and calls security_reviewer, test_reviewer and style_reviewer as tools, in parallel. Each returns findings. The lead removes duplicates, ranks them and writes one review. Handoffs would not work here: the lead must still be running after the three workers finish.
Key points
- A handoff transfers control of the conversation; an agent as a tool returns a result to the caller.
- Orchestrator-worker designs call workers as tools so the lead can merge and check.
- Use a handoff when the user should continue the chat with a specialist.
- Tool calls pass only the input you give, which keeps worker context small and clean.
- Give each worker tool a distinct name and description so the lead chooses correctly.
Common mistakes
- Using handoffs for workers whose results the lead must combine.
- Giving several worker tools near-identical descriptions.
- Forwarding the whole conversation to each worker instead of a short brief.
- Assuming every SDK uses the same terms; check what each one calls these two patterns.
Check yourself · 2 of 3
A lead needs reports from a pricing worker and a features worker, then must write one comparison. Which design fits?
Check yourself · 3 of 3
A customer asks a front-line agent a tax question that a tax specialist agent should answer for the rest of the chat. Which is the better fit?
Practice items, not counted towards your mastery.
Start here
- How we built our multi-agent research system (Anthropic) (opens in a new tab)ArticleFree
A lead agent with parallel subagents in production: briefs, scaling rules, token cost (about 15x a chat) and lessons learned.
- Building effective agents (Anthropic) (opens in a new tab)ArticleFree
Describes the orchestrator-workers workflow and advises starting with the simplest design that works.
- Orchestrating multiple agents (OpenAI Agents SDK) (opens in a new tab)DocsFree
Compares orchestrating through an LLM with orchestrating through code, and shows handoffs and agents as tools.
More for this topic
- Handoffs (OpenAI Agents SDK) (opens in a new tab)DocsFree
How one agent hands the conversation to another, with input filters and handoff descriptions.
- Tools, including agents as tools (OpenAI Agents SDK) (opens in a new tab)DocsFree
Shows an agent exposed as a tool so the caller keeps control of the conversation.