Start course

Week 2 · Day 6 of 10

Agents: multi-step work with real actions

Students can build a bounded agent that takes real actions with tools, including one reached through MCP, and argue when a fixed workflow is the better design.

Robert introduces today: what you'll learn, what you'll build, and why it matters. About two minutes.
In pink: what day 6 adds to the app.
Day 6 adds Agent loop, MCP servers to the student's app, which already has Your user, FastAPI app, Model, Typed JSON, Tools, Your documents, Evals.
1LearnTool loops, MCP and when to stop

Multi-step tool loops, stopping conditions, reading an agent's trace, and when a fixed workflow beats an agent. The Model Context Protocol as the standard way to plug in outside systems: connecting to an existing MCP server, and keeping its permissions narrow because its output is untrusted.

How it worksStep 1 of 5

How an agent works in a loop

  1. A goal
The agent gets a job, like researching a company and saving a note.
Try it liveRuns on a real model

Try it live

An agent loop you can watch

The agent can search this course and use a calculator, deciding each step itself. It has to stop within 5 steps.

Claude Haiku 5.5 through the AI Gateway
Check your understanding3 questions
  1. What makes something an agent rather than a workflow?

  2. Why does every agent loop need a stopping condition?

  3. Before connecting a third-party MCP server, what should you check?

2BuildResearch, draft and save, in one agent

An agent that finishes a multi-step task (research, draft, save) using your tools and one existing MCP server, and stops at a set limit.

Done when: an agent finishes a task in several steps, uses an MCP server, and stops at a set limit.

3CapstoneOne real multi-step flow, or why not

One multi-step flow that takes a real action for your user, or a written case for why a fixed workflow is better.

4HomeworkAnnotate an agent's trace

Read one agent's trace step by step and annotate each decision it made.

For teachers: the day 6 teaching kit.