Idempotent Tools and Side Effects
An agent may retry — design tools so calling them twice doesn't double-charge or double-email.
Why Idempotency Matters
An agent loop may retry. If a tool sends an email or charges a credit card, retrying duplicates the action. Idempotency makes "do X again" a no-op when X already happened.
What Is Idempotency?
An operation is idempotent if calling it N times produces the same effect as calling it once. Examples:
- "Set user status to active" — idempotent (re-setting to active does nothing)
- "Increment counter by 1" — NOT idempotent (each call adds 1 more)
All lessons in this course
- Idempotent Tools and Side Effects
- Retries with Exponential Backoff
- Timeouts and Circuit Breakers
- Validating Tool Outputs (Pydantic)