Skip to content

How tool use turns a model into an agent

This is lesson 2 of Track 20, still in Phase 1 (What an agent actually is). Lesson 1 left you with a definition: an agent is a model in a perceive-decide-act loop with tools. Every example there turned on one move, “the agent calls a tool,” without saying what that means mechanically. This lesson answers it. A language model cannot run code, so it does not run the tool; it writes a structured request, and the loop runs the tool and feeds the result back. You will trace that exchange step by step until the mechanism behind every agent feels concrete rather than magical.

The track structurally mirrors Microsoft’s “AI Agents for Beginners” (MIT-licensed); this lesson follows its Tool Use Design Pattern material. Full attribution is in this lesson’s references.

This is the mechanism lesson that the rest of the track stands on. Lesson 1 named the loop; this lesson shows the single move that drives it. The next lesson zooms back out to a practical question, whether to hand-roll that loop yourself or adopt a framework that provides it. Later lessons (tool-definition design, memory, retrieval, planning) all assume you understand the four-step exchange covered here.

Prerequisite: Lesson 1, What makes an AI an “agent”. You need the perceive-decide-act loop and the four-part anatomy (model, system prompt, tools, loop) from that lesson; this one looks closely at the tool-calling step inside it. No coding or math required.

  • Explain why a model emits a tool call rather than running the tool itself (propose vs dispose)
  • Trace the four-step tool-call exchange (describe, request, execute, decide) end to end
  • Describe how the model chooses among multiple tools from their descriptions and the request
  • Explain how a tool failure is handled as just another result fed back to the model
  • Recognize that a tool call is only text in a shape the loop agrees to recognize
  • Read time: about 11 minutes
  • Practice time: about 15 minutes (order-the-steps and trace-a-tool-call exercises plus flashcards)
  • Difficulty: standard