Tool Design and Contracts
Idempotent Tools
An idempotent tool produces the same result regardless of how many times you call it with the same arguments, making it safe to retry on failure without causing unintended side effects. This property is critical for agent systems because agents frequently retry failed tool calls, and without idempotency a retry could create duplicate records, send duplicate messages, or double-charge a payment. Designing tools to be idempotent by default, using unique request IDs, upsert operations, and check-before-act patterns, is one of the most important reliability practices for production agent systems.
subtopics
connected to
resources
Stripe: Idempotent Requestsstripe.comHow Stripe uses idempotency keys to prevent duplicate operations (stripe.com)Building Effective Agentsanthropic.comAnthropic's guidance on designing reliable tools for agent systems (anthropic.com)Idempotency Patternslearn.microsoft.comMicrosoft's documentation on implementing idempotent operations in distributed systems (learn.microsoft.com)Anthropic: Tool Use Best Practicesdocs.anthropic.comPatterns for designing reliable, retryable tools for Claude (docs.anthropic.com)