Skip to content

The tool-use design pattern in depth

This is lesson 4, opening Phase 2 (The design patterns that make agents work). Lesson 2 showed the mechanism of a single tool call; this lesson is about making the model call the right tool at the right time, which turns out to depend almost entirely on one thing: the tool definition. Because the model decides from the description and nothing else, writing good definitions is the highest-leverage skill for agent reliability. You will learn the four parts of a definition, see bad-versus-good descriptions side by side, and practice the moves that prevent the most common tool-use failures.

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 lesson opens the design-patterns phase and is the most directly practical lesson so far. It builds straight on Lesson 2 (the tool-call mechanism) and feeds everything after it: memory, retrieval, planning, and trustworthy agents all rely on tools, so the definition discipline here applies throughout. The next lesson turns to memory, what an agent holds on to within a run and across runs.

Prerequisite: Lesson 2, How tool use turns a model into an agent. You need the four-step exchange (describe / request / execute / decide), because this lesson is about shaping the first step of that exchange so the model gets it right. No coding or math required, though the examples are written as tool definitions.

  • Explain why the model selects tools and fills arguments from descriptions alone
  • Write a tool definition with all four parts (name, description, parameters, expected output) the model can use reliably
  • Add when-to-use and when-not-to-use (negative) guidance to a tool description
  • Draw an explicit boundary between two tools that would otherwise be confused
  • Design tool output that is legible enough for the model to act on
  • Read time: about 11 minutes
  • Practice time: about 15 minutes (fix-a-bad-definition and disambiguate-two-tools exercises plus flashcards)
  • Difficulty: standard