Lesson 03 · Applied LLM Engineering

Tool Use & Agents

The workflow-vs-agent decision, tool descriptions as an engineering discipline, MCP as the integration seam, and the judgment to say "you don't need a multi-agent system" to a customer who wants one.

FDE skill · Anthropic's posting literally lists these as your deliverables
🎧 Listen to this lesson · ~10 min · narrated audiobook edition

⏱ ~10 min read · 🎧 10 min listen · ✎ 3 quizzes · 🧪 ~90 min lab

Go back to the job posting from Lesson 01. Anthropic's FDE role asks you to "deliver technical artifacts for customers like MCP servers, sub-agents, and agent skills".4 This lesson is those deliverables. Tool use is what turns a model that talks into a system that acts — looks up the customer's data, calls their APIs, files the ticket. And the single most important decision you'll make on site, over and over, is deceptively simple: does this problem need an agent at all?

Workflows vs agents: the canonical decision

Anthropic's "Building Effective Agents" — still the standard framing — draws one line through everything: workflows are systems where LLMs and tools are orchestrated through predefined code paths; agents are systems where the LLM dynamically directs its own processes and tool usage.1 In a workflow, your code decides what happens next. In an agent, the model does — it runs in a loop, calling tools, reading results, deciding the next step. The guidance that follows from it is the part customers least expect to hear: find the simplest solution possible, and only increase complexity when needed.1 Most "agent" products in production are workflows, and that's a compliment.

PatternWhat it isReach for it when
Prompt chainingFixed sequence of LLM calls, each feeding the nextThe task decomposes into known, ordered steps
RoutingA classifier call picks which specialised path handles the inputDistinct input categories need distinct handling
ParallelizationSeveral calls run at once; results are aggregated or voted onIndependent subtasks, or you want multiple takes
Orchestrator–workersA lead call breaks work down and delegates to worker callsSubtasks can't be predicted in advance
Evaluator–optimizerOne call generates, another critiques, loop until goodClear evaluation criteria; iteration adds real value
AgentModel directs its own tool loop until the goal is metThe path genuinely can't be enumerated up front

So when do you actually build the agent? Four questions, all of which must come back "yes": is the task complex enough that you can't specify the steps in advance? Is it valuable enough to justify the extra tokens and latency? Is the model actually viable at this kind of task? And can errors be caught and recovered — via tests, review, or rollback?1 A "no" on any of them means you build a workflow, whatever the customer's slide deck says. This is your first AI-judgment rep in the technical stack: an invoice pipeline with five fixed steps sold as "an AI agent" is a routing workflow, and telling the customer so — with the cost and reliability argument — is the job.

Three rules from the field Anthropic's applied-AI team compresses their agent experience to three lines: don't build agents for everything, keep it as simple as possible, and think from the agent's perspective — read your context window and ask "could I act sensibly on only this?" That last habit will debug more agents than any tracing tool.

Tools are prompts: the design discipline

A tool is three things: a name, a description, and a JSON input schema.5 Here's the mental shift that separates working agents from flailing ones: the tool description is prompt engineering. The model decides when and how to call your tool based entirely on what you wrote there. Anthropic's tool-writing guidance reads like advice for onboarding a new hire, because that's exactly what it is: write descriptions that say when to use the tool, not just what it does; consolidate — a few purposeful tools beat a thin wrapper per API endpoint; namespace related tools (clinic_search_slots, not search2); and return meaningful, human-readable context — names and statuses, not bare UUIDs the model can't reason about.2

The loop mechanics are simpler than they sound. You send the model a request with your tool definitions; if it wants a tool, the response comes back with stop_reason: "tool_use" and the arguments; your code executes the tool, appends the result to the conversation, and calls the API again — until the model answers without asking for a tool.5 That while-loop is an agent. Everything else — memory, planning, sub-agents — is refinement. You'll write this loop from scratch in today's lab precisely so it never feels like magic again.

MCP: the integration seam

Every tool you write today is welded to your own harness. The Model Context Protocol fixes that: an open standard for connecting AI applications to tools and data sources through one interface — commonly described as USB-C for AI.6 For an FDE this is the integration seam: wrap the customer's scheduling system as an MCP server once, and Claude, their IDE assistant, and next year's app can all use it. The spec also bakes in the security posture you'll need on site — user consent, explicit authorization for tool execution.7 Today you just need the concept; Lesson 07 has you building MCP servers against messy enterprise systems for real.

The Claude Agent SDK: don't rebuild the harness

Once you've written the raw loop, you'll appreciate what a harness gives you. The Claude Agent SDK packages the production agent loop — built-in file and shell tools, MCP connections, sub-agents, permission hooks, session management — as a library you call with a prompt and options.8 The FDE decision pattern: raw API + your own tools when the agent is small and the tool surface is custom (today's lab); the Agent SDK when the customer needs a capable general agent on their infrastructure fast. Knowing both — and which one a given engagement needs — is exactly the "agent development" line on your gap map.

Multi-agent: powerful, expensive, usually premature

Multi-agent systems are real — Anthropic's own Research feature runs an orchestrator that spawns parallel sub-agents, and it beat a single-agent baseline by 90% on internal research evals. But read the fine print like an FDE: agents use about 4× more tokens than chat, and multi-agent systems about 15× — so the economics only work for high-value tasks, and the architecture only pays off when the work genuinely parallelizes, like breadth-first research across independent sources.3 Sequential tasks where every step depends on the last — most coding, most form-filling, most support flows — gain little and pay everything. When a customer asks for "a team of agents," your first question is the one from this lesson's third quiz: what part of this work is actually parallel?

The mental model in one line Climb the ladder only as far as the problem forces you: single call → workflow → agent → multi-agent — and at every rung, the tool descriptions are doing more work than the architecture.

🧪 Practical steps: triage assistant with tools (~90 min)

Time to build. Your customer is the course's fictional virtual-care provider, and the question their intake staff ask forty times a day is: "can nurse triage handle this, or does it need a GP telehealth slot?" You'll build an agent that answers it by calling real tools — a clinic-availability lookup over a small JSON dataset and a triage-protocol search over provided text snippets. One of the three tools ships with a deliberately bad description: you'll watch the agent fail, fix the description using this lesson's principles, and document the before/after. That failure analysis is the most interview-quotable part of the artifact. Full instructions and starter code are in labs/0003-triage-agent.md.

  1. Set up — create D:\Projects\FDE-Portfolio\l03-triage-agent\, copy the starter file and dataset from the lab instructions, confirm ANTHROPIC_API_KEY is set and pip install anthropic is current.
  2. Read the tool definitions first — before running anything, predict which tool the model will struggle with and why. Write your prediction down.
  3. Write the agentic loop — the starter marks a TODO: loop while stop_reason == "tool_use", execute the requested tools, return tool_result blocks, repeat.
  4. Run the five test questions — routing questions of increasing nastiness are in the starter. Log every tool call the model makes.
  5. Observe the failure — one tool has a uselessly vague description. Capture the misbehaviour concretely: wrong tool chosen, malformed arguments, or the model guessing instead of calling it.
  6. Fix the description — rewrite it per this lesson: say when to use it, describe each parameter, name the return format. Re-run the same five questions.
  7. Document before/after — in README.md: the bad description, the observed failures, the fixed description, the new behaviour, and one paragraph justifying why this problem got an agent rather than a workflow.
  8. Commit the artifact — code, dataset, README. This agent gets a real MCP integration in Lesson 07 and production hardening in Lesson 08 — it's a running character in your portfolio, not a throwaway.

Feedback loop: bring your README and transcript back to me in chat and I'll review it like a staff engineer would — is the workflow-vs-agent call justified, do the tool descriptions follow the principles, and is the failure analysis honest about what broke? This artifact feeds the Lesson 11 capstone engagement and is tracked in reference/artifact-tracker.html.

🤖 Get your work reviewed

No chat here — this box replaces it. Copy the prompt into any AI assistant (Claude, ChatGPT, Gemini…), then paste your README and a sample run transcript after it.

You are a staff-level applied AI engineer reviewing my work: a patient-routing triage agent for a virtual-care provider, built in Python with the anthropic SDK. It uses an agentic tool-use loop over 2–3 tools (clinic availability lookup, triage protocol search). The lab included a deliberately bad tool description; I observed the failure, fixed the description, and documented before/after.

Grade each criterion as Strong / Adequate / Missing, with one sentence of evidence:
- Workflow-vs-agent justification: the README argues from the actual decision criteria (unpredictable paths, value, viability, recoverable errors) why this is an agent and not a routing workflow — or honestly concedes where a workflow would do.
- Tool description quality: each tool description says WHEN to use the tool, documents every parameter, and the tools return human-meaningful context (names/statuses, not bare IDs).
- Failure-analysis honesty: the before/after documents concrete observed misbehaviour (which calls went wrong and how), not a vague "it worked better afterwards".

Be skeptical — probe the weakest criterion first. Then ask me 2–3 follow-up questions an FDE interviewer would ask about this build (e.g. how I'd eval it, what breaks at 10× tool count). Finish with the single highest-leverage improvement.

My README and transcript follow below.
🧭 Field practice this week

Check yourself — think like an FDE

Scenarios, not recall. Diagnose from the mental model — don't scroll up. Wrong picks stay live.

Scenario A

A health-insurer customer's exec sponsor opens the kickoff with: "The board approved budget for an AI agent." The actual need: incoming claims get classified into five categories, each with a fixed handling sequence — extract fields, validate against the policy, route to the right queue. The steps never vary within a category. What do you build, and what do you tell the sponsor?

Scenario B

On site, a customer's half-built agent keeps failing: asked about order status, it sometimes calls data_query with malformed arguments, sometimes answers from memory without calling anything. The tool is described as "Queries the data store" with one parameter, q (string). The team is about to swap to a bigger model to fix it. What's your diagnosis?

Scenario C

A well-funded customer read about orchestrator–worker research systems and wants their contract-drafting assistant rebuilt as "a swarm of specialist agents" — one for clauses, one for compliance, one for tone. Drafting is strictly sequential: each section depends on the previous ones. They ask for your honest take. What is it?

Primary source — read this
The canonical workflow-vs-agent framing and the five composable patterns — still the vocabulary every agent conversation uses. Pair it with "Writing effective tools for agents" (Sep 2025), which turns this lesson's tool-design principles into a full checklist with evals.
Your one tangible win You can now make the workflow-vs-agent call out loud, with reasons a customer accepts — and you have a working tool-using agent in your portfolio whose README documents a tool-design failure you diagnosed and fixed yourself. That before/after story is an interview answer for "tell me about debugging an LLM system."
Questions? Any AI assistant is your teacher. Not sure whether your loop handles parallel tool calls correctly, or whether your fixed description goes far enough? Paste the relevant section of this lesson into your AI assistant along with your code — and for the full rubric review, the box above has you covered.

Recommended learning

Hand-picked follow-ups. None are required — the primary source above comes first.

References

  1. Anthropic, "Building Effective Agents" (Dec 19, 2024) — workflows vs agents definitions; the five workflow patterns; "find the simplest solution possible"; when to build agents.
  2. Anthropic, "Writing effective tools for agents" (Sep 11, 2025) — tool consolidation, namespacing, meaningful context over raw IDs, descriptions as if onboarding a new hire, tool evals.
  3. Anthropic, "How we built our multi-agent research system" (Jun 13, 2025) — orchestrator-worker architecture; agents ≈4× and multi-agent ≈15× chat token usage; parallelizable, high-value tasks.
  4. Anthropic, Forward Deployed Engineer, Applied AI — job posting (2026) — "deliver technical artifacts for customers like MCP servers, sub-agents, and agent skills".
  5. Anthropic, Tool use overview — Claude Docs (current) — tool definition structure (name, description, input_schema), the tool_use / tool_result loop, tool_choice.
  6. Model Context Protocol, Introduction (current) — open protocol for connecting AI applications to tools and data sources; the USB-C analogy.
  7. Model Context Protocol, Specification (rev 2025-11-25) — architecture; security and trust principles: user consent, explicit tool-execution authorization.
  8. Anthropic, Claude Agent SDK — overview (current) — agent harness with built-in tools, MCP, subagents, hooks, permissions, sessions.
  9. Chip Huyen, "Agents" (Jan 7, 2025) — agent planning, tool selection, and compound-error failure modes.