Lesson 46
Designing tools
Build an LLM From Scratch, 53 lessons
Lesson 46: Designing tools
Build an LLM From Scratch, Lesson 46 of 53

The same failed edit costs the coding agent a different number of laps depending on one sentence the tool writes back. Play the failures, be the model reading a menu of tools, and lose a reply to see why a retry must be safe.
The question for this lesson: what makes a tool one a model can pick and use correctly?
Lesson 45 ended with a simple mechanism. The model writes a call as text, the program reads it, checks it, runs it, and writes the result back. Nothing in that mechanism is hard.
Yet agents flail. They call the wrong tool, repeat a failed call, or do a job again. When that happens, the model is rarely the only thing to blame. The model works from the words a tool gives it, and a tool can give it too few.
In this agent, the model is not given the tool’s implementation. It works from text including:
The rest of this lesson is in Premium
Premium includes every lesson, with its notes, practice and progress.