Module 3 of 7Lesson 2 of 2~17 min
Specify tool errors and idempotency
When a tool fails or responds too slowly, an agent may retry, insist or trigger the same action twice for a customer. This lesson teaches you to specify what a tool should return on error and how to make it safe to call again, so that failures stay harmless.
Lesson objective
By the end of this lesson, you will be able to specify the error messages a tool returns to the agent, make tools with side effects idempotent and describe the expected behavior on timeout or partial failure.
Topics covered
- idempotency
- error handling
- tool calling
- agent reliability
- side effects
In the glossary
Where it fits
Design tools the model uses well
Which tools should the agent get, how should they be described, and what happens when they fail?
Lessons in this module
- Write tool cards the model uses well
- Specify tool errors and idempotency (this lesson)
What you will learn in this module
This lesson is part of the course Design reliable agents and tool calling
- Write tool cards the model uses well (name, description, parameters, return, errors, idempotency, risk level).
Related courses
- AI & ProductAdvancedRegular practice: you already use the tools or work on this topic.
Build an AI assistant for your product
3 hr
- AI & ProductAdvancedRegular practice: you already use the tools or work on this topic.
Design a RAG architecture that fits your product
3 hr 30 min
- AI & ProductAdvancedRegular practice: you already use the tools or work on this topic.
Evaluate an AI feature: test sets, metrics and LLM judges
3 hr