---
title: "Idempotency"
url: https://eldan.ai/glossary/idempotency
canonical: https://eldan.ai/glossary/idempotency
locale: en
language: en
published: 2026-11-23
updated: 2026-11-23
author: "Eldan Abdrashim"
cite_as: "Eldan Abdrashim. \"Idempotency.\" Eldan.ai, 23 November 2026. https://eldan.ai/glossary/idempotency."
---

# Idempotency

> An operation is idempotent when doing it several times has the same effect as doing it once. This matters for agents because retries are common: a timeout may hide a call that actually succeeded. An idempotency key lets the receiving system recognise a repeat and ignore it.

Reading is naturally idempotent. Sending an email or charging a card is not, unless you design it to be. Generate a key from the logical action, such as the order id plus the action name, not from a random value created on each attempt.

**Common mistake.** Retrying a write after a timeout with no key, and charging a customer twice.

**In practice.** Require an idempotency key on every tool with a side effect, store results by key for a period, and return the stored result on a repeat.

## Related terms

- [Tool calling](https://eldan.ai/glossary/tool-calling)
- [Human in the loop](https://eldan.ai/glossary/human-in-the-loop)
- [Agent loop](https://eldan.ai/glossary/agent-loop)

## Used in

- [Tool Calling From Scratch](https://eldan.ai/tutorials/tool-calling-from-scratch)
