agentsop-llm-tool-idempotency

Implement idempotency keys to prevent duplicate side-effectful tool executions.

287|16|Updated May 20, 2026
One-click install
npx skills add https://github.com/agentsope/SkillAlchemy --skill agentsop-llm-tool-idempotency
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agentsop-llm-tool-idempotency
Source: https://github.com/agentsope/SkillAlchemy/tree/main/skills/agentsop-llm-tool-idempotency
Command: npx skills add https://github.com/agentsope/SkillAlchemy --skill agentsop-llm-tool-idempotency

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents side-effectful LLM agent tools from executing twice when retries happen due to timeouts, framework resume, or duplicate tool-call emissions, avoiding outcomes like duplicate emails, double charges, and duplicate records.

Core Features & Use Cases

  • Decision protocol for at-most-once effects: Implements the rule that the LLM is at-least-once while the tool must engineer at-most-once execution using a caller-supplied idempotency key and dedup at the execution boundary.
  • Framework-agnostic operating models (OP-1..OP-8): Covers native idempotency APIs (e.g., Stripe-style headers), internal dedup tables, content-addressed writes, database upsert/insert patterns, saga compensation, and orchestrator-specific guidance for LangGraph interrupts and MCP tool schemas.
  • Production guardrails and failure handling: Includes dilemma cases, anti-patterns, conflict handling rules (e.g., same key different args), and cross-framework comparisons to ensure duplicates are blocked rather than silently re-triggered.

Quick Start

Ask an engineer to implement idempotency keys for a side-effect tool so that retries become safe no-ops instead of double-send behavior.

Frequently Asked Questions about agentsop-llm-tool-idempotency

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent duplicate side effects when LLM agent tool retries happen?▼

To prevent duplicate side effects from LLM agent tool retries, implement at-most-once execution using a caller-supplied idempotency key and deduplication at the execution boundary. This ensures retried calls become safe no-ops instead of triggering duplicate external actions.

Why do duplicate tool calls happen in LangGraph and how do I make them idempotent?▼

Duplicate tool calls in LangGraph happen due to framework resume, transport timeouts, or model duplicate emissions. Make them idempotent by implementing execution-boundary dedup logic with stable idempotency keys, ensuring the second call is blocked as a no-op with observability.

What are the best patterns for idempotency in distributed LLM systems?▼

The best patterns for idempotency in distributed LLM systems include native idempotency APIs with headers, internal dedup tables, content-addressed writes, and database upsert patterns. These approaches block duplicates at the execution boundary rather than silently re-triggering effects.

Can I use idempotency keys to handle MCP transport timeouts safely?▼

Yes, you can use idempotency keys to handle MCP transport timeouts safely. By requiring caller-supplied stable keys and applying execution-boundary dedup logic, retried MCP tool calls become no-ops, preventing double charges or duplicate records when timeouts occur.

What happens if an LLM agent sends the same idempotency key with different arguments?▼

When an LLM agent sends the same idempotency key with different arguments, conflict handling rules apply. The protocol includes production guardrails and anti-patterns to ensure duplicates are blocked, preventing inconsistent state from mismatched retry arguments.

Do I need native API support to deduplicate tool calls in LLM agents?▼

You do not need native API support to deduplicate tool calls in LLM agents. The protocol covers framework-agnostic operating models including internal dedup tables, saga compensation, and orchestrator-specific guidance for LangGraph interrupts and MCP tool schemas.