Skip to main content
Glama

idempotency-registry

Idempotency registry: has key K already been done? Claim it, complete it, read the stored result — Shared memory for side-effecting operations across agents and retries. begin(key) answers proceed (you hold a short claim), wait (another owner is mid-flight), already_completed (returns the stored result pointer), or fingerprint_mismatch (same key, different operation). complete(key) records the result pointer; abandon(key) lets someone retry. The claim expires, so a crashed worker does not block

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "op": "<op>",
      "key": "<key>"
    },
    "name": "idempotency-registry"
  }
}

Input Schema

NameRequiredDescriptionDefault
opYes
keyYesIdempotency key, e.g. refund:ch_123:2026-11-04.
ownerNoWorker id; required for begin, complete and abandon.
resultNocomplete: where the outcome lives (do not store payloads here).
tenantIdNoRequired for API-key callers (namespaced as key:<tenantId>; keep it unguessable). Ignored when a wallet paid: the payer address is the tenant.
requestIdNoCaller-chosen id for this mutation. A retry with the same id and same input returns the stored response (24 h) instead of applying twice; the same id with different input is rejected. Send one on every mutation you may retry: without it a retry is applied again (fleet-memory record appends a duplicate; a repeated spend-ledger commit or release answers NO_HOLD because the first call already took effect).
fingerprintNoHash of the operation's identity fields; a later begin with a different fingerprint is refused.
claimSecondsNoHow long a begin claim lasts; default 300.
retentionHoursNoHow long a completed key is remembered; default 24.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that claims expire so a crashed worker does not block, that a mismatched fingerprint is refused, and that complete stores only a result pointer. It omits auth/tenant scoping and what get returns, which the schema partially covers.

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?

Front-loaded with the core question and the operation list, and every clause carries information. The single dense paragraph is slightly run-on, but there is little wasted wording.

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-parameter, nested-object tool with no output schema, the description covers the operation lifecycle, claim expiry, and result-pointer storage adequately. Remaining gaps (return shape of get, tenant/auth behavior) are largely handled by the schema's own descriptions.

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 coverage is 89%, so the baseline is 3; the description adds real meaning by explaining what each op does and what the claim/result semantics are, which the enum alone does not convey. It does not elaborate on owner, claimSeconds, or retentionHours beyond the schema text.

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

Purpose5/5

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

States a specific resource (idempotency registry) and the concrete question it answers ('has key K already been done?'), then enumerates the operations (begin/complete/abandon/get) and their outcomes. An agent can tell this apart from a fingerprinting or cache-check sibling without opening the schema.

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

Usage Guidelines4/5

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

Frames the use case explicitly ('shared memory for side-effecting operations across agents and retries') and explains the begin outcome branches (proceed/wait/already_completed/fingerprint_mismatch) plus when to call complete vs abandon. It stops short of naming when not to use it or pointing at a specific alternative tool.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources