Claude, Anthropic's family of models, builds agents through tool use: you describe tools with a name, description, and input schema, and Claude replies…
See how Claude requests tools and your code executes them.
Building an agent with Claude starts with tool use. You send Claude the user's message plus a list of tools, each defined by a name, a description of when to use it, and an input schema for its arguments. When Claude decides a tool is needed, it responds with a structured tool-use request naming the tool and arguments — it does not run anything itself.
Your code executes the requested tool and returns the result to Claude, which then continues. This clean separation — Claude decides, your code acts — is what lets you validate and control every action.
Turn single tool calls into an agent by looping.
A single tool call answers a one-step question. An agent loops: send the conversation to Claude; if it returns a tool-use request, run the tool, append the result, and call Claude again; repeat until Claude returns a normal text answer instead of a tool request. Add a step limit as a safety valve so it can't loop forever.
That loop — decide, act, observe — is the whole agent pattern. Claude can also request several tools in one turn for independent work, which you run together.
messages = [{"role": "user", "content": task}]
while True:
resp = claude.messages(tools=tools, messages=messages)
if resp.stop_reason != "tool_use":
break # final answer
messages.append(resp) # Claude's tool request
results = run_tools(resp) # YOUR code executes
messages.append({"role": "user", "content": results})
print(resp.text)Each iteration lets Claude either call tools or finish. When it requests tools, your code runs them and appends the results, then loops. The stop_reason tells you when Claude is done — that's the exit.
Follow Anthropic's guidance to add complexity only when needed.
Anthropic's practical guidance is to reach for the least complexity that solves the problem. Many tasks don't need an autonomous agent at all — a fixed workflow of predefined steps (each possibly an LLM call) is more predictable and cheaper. Use an agent, the tool-use loop, only when the steps genuinely can't be known in advance.
When you do build an agent, keep it simple: a clear loop, a small set of sharp tools, and good stop conditions beat elaborate orchestration. Add multi-agent structure only when a task truly splits into distinct roles.
Use Claude-friendly patterns and avoid the common errors.
A useful pattern is supplying tools through the Model Context Protocol (MCP): instead of hand-wiring each integration, connect Claude to MCP servers that expose tools and data in a standard way, so tools are reusable across apps. Beyond that, invest in tool design — clear names, precise descriptions, and strict input schemas — since that's what makes Claude choose and call tools correctly.
For higher-level building, Anthropic also offers an Agent SDK that packages the loop, sessions, and tooling, but the underlying pattern is the same tool-use loop.
Watch for: vague tool descriptions so Claude misuses or ignores them; no step limit so a loop can run away; not validating tool arguments before executing (Claude can be steered by injected content); building a full agent when a fixed workflow would be more reliable; and giving broad, risky tools without human approval. Sharp tools, a bounded loop, and least privilege are the essentials.
Agents with Claude are built on tool use: you describe tools with a name, description, and input schema; Claude returns structured tool-use requests; your code executes them and returns results. Looping this until Claude gives a final answer — with a step limit — is the core agent pattern. Anthropic advises using the least complexity that works, often a fixed workflow, and reaching for agents only when the path is unknown. Supply tools reusably via MCP, design tools sharply, validate arguments, and keep least privilege.
Design a Claude agent that looks up orders and drafts replies. Write two tool definitions with sharp descriptions, decide the step limit and one argument validation, and explain when you'd use a fixed workflow instead of the agentic loop for part of the task.
How does building an agent with Claude tool use work?
Claude decides which tool to call and with what arguments; execution is always on your side, keeping you in control.
What turns single tool calls into a Claude agent?
The decide-act-observe loop, bounded by a step limit, is the core agent pattern built on tool use.
What is Anthropic's guidance on building agents?
Simple, predictable workflows beat autonomous agents when the path is known; agents are for genuinely open-ended tasks.
What pattern helps supply tools to Claude in a reusable way?
MCP standardizes tool and data access so integrations are reusable across apps, complementing good tool design.