CH 03 · Tool Design · 01/18
Read as one pageTool Design
A tool's description doubles as a prompt the model reads before acting. Covers granularity, schema discipline, and structured input design.
18 slides · 16 min read
In this chapter
- 01What a tool is
- 02The description is a prompt
- 03Real code: Gemini CLI's edit tool teaches through its description
- 04Granularity: how big should a tool be?
- 05The cheap/expensive pairing- A way to reduce token usage in models :-P
- 06Real code: OpenCode's grep returns a small, capped answer
- 07Batching
- 08Real code: pi's edit tool takes many edits in one call
- 09Schema discipline
- 10Real code: Codex's update_plan schema leaves little to guess
- 11Structured input for deterministic output
- 12Tool results are also an interface
- 13Real code: pi's read tool tells the model how to continue
- 14Scoping tools to the surface
- 15Tools and the provider abstraction
- 16A checklist for a well-designed tool
- 17Read the source yourself
Tools are how an agent acts. The set of tools defines what an agent can do; the design of those tools determines whether the model uses them correctly. This chapter is about designing tools and their schemas well, arguably the highest-leverage skill in building agents, because a well-designed tool turns an unreliable model into a reliable system, and a badly-designed one does the opposite.
Finished this idea?
Your learning progress stays in this browser.