Skip to main content
Glama

manage_idempotency_key

Prevent duplicate payments, orders, and retried LLM actions by atomically claiming, resolving, releasing, and checking idempotency keys with cached results.

Instructions

    [Cost: $0.0002 USDC on Base & Solana] Atomic idempotency vault & execution deduplication fence.
    
    Keywords: idempotency vault, deduplication fence, replay protection, lock key, dedup.
    Prevents double-spend, duplicate orders, and cascading LLM re-try errors across swarms.

    Actions:
    - 'claim': Atomically lock key or retrieve cached output. Params: key, scope, payload, lock_timeout_seconds, ttl_seconds.
    - 'resolve': Store execution result and mark COMPLETED. Params: key, scope, output, ttl_seconds.
    - 'release': Unlock key immediately on worker error. Params: key, scope, reason.
    - 'status': Free inspection of key state and cached result. Params: key, scope.

    Args:
        action: Vault operation ('claim', 'resolve', 'release', 'status').
        key: Optional explicit idempotency key. If omitted in claim, derived from payload SHA-256.
        scope: Optional namespace scope to isolate swarms.
        payload: Input payload or tool arguments to auto-fingerprint.
        output: Result payload to cache upon task completion.
        lock_timeout_seconds: Lock duration before timeout (default: 60s).
        ttl_seconds: Cache retention duration for completed results (default: 86400s).
        reason: Explanation if releasing lock on failure.
        payment_signature: Optional x402 transaction hash (defaults to developer mock key).
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNo
scopeNo
actionNoclaim
outputNo
reasonNo
payloadNo
ttl_secondsNo
payment_signatureNo
lock_timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.1

TDQS

A3.8/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden and does a good job: it discloses the cost ($0.0002 USDC on Base & Solana), that claim is atomic, that the key is auto-derived from a payload SHA-256 when omitted, and it gives concrete defaults (lock 60s, TTL 86400s). It still omits what happens on a lock conflict or a resolve against an unclaimed key, which keeps it from a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The cost and purpose are front-loaded, and the Actions/Args sections are scannable. It loses a point for the 'Keywords' line, which is SEO-style padding rather than information the agent needs to select or invoke the tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-param, no-annotation, no-output-schema mutation/payment tool, the description is thorough: actions, per-action params, defaults, key derivation, and pricing are all covered. The main missing piece is return/conflict semantics (what claim returns when a key is already locked), which an agent would want before relying on it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it largely does: all nine parameters are given meaning (key derivation, scope isolation, payload fingerprinting, output caching, lock/ttl defaults, reason, payment_signature) and are grouped per action. Minor gap: it does not state the type/shape expectations for 'output' or 'payload' beyond name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb+resource combination ('Atomic idempotency vault & execution deduplication fence') and enumerates four concrete actions (claim/resolve/release/status), so the agent knows exactly what the tool does. However, it never distinguishes itself from similarly-shaped siblings such as scratchpad_lock/scratchpad_unlock or lsh_dedup, so it stops short of a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through the action list (release 'on worker error', status for 'free inspection'), which hints at the lifecycle, but there is no explicit 'use this when... instead of X' guidance and no exclusions relative to the lock/dedup siblings. Minimum-viable context, not routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.