Medium · How an agent uses a tool
When the tool fails
Sometimes the dairy’s order system does not answer in time. The first order may have gone through anyway. A careful setup sends the model one short line, not pages of error text. It counts tries and hands the job to Milo after three. Each try carries the same retry key, so the dairy can spot and ignore a repeat.
Video coming
Example
Maple Mart orders milk, key MM-0412 try 1 the dairy timed out; order status unknown try 2 same order, same key MM-0412 the dairy: already have MM-0412, ignored Milo gets 12 cases, not 24.
Try it Yourself
The dairy timed out on order MM-0412. Write what the agent sends on its second try.
Exercise
What can go wrong if the agent simply tries again with no key?