Chapter 6: The agent

Tool

A function the harness offers the model, described by a name, a purpose and the inputs it takes. The model can only write a request to use it. The harness checks the request, runs the function and returns the result.

Tools set the limit of what an agent can do, and their output is how it learns what happened. An error that names the fix makes it better without touching the model. A 5,000-line dump makes it worse and costs you for the privilege.

Say it to your agent

“Write a search_orders tool with inputs customer_id (string) and status (open or shipped). Return at most 20 rows. If customer_id is missing, the error must say what to pass, not just "invalid input".”

The workshop

Name a word, or describe what you mean in everyday language.