Skip to main content
Glama

MCPFax Agent Continuity

Acquire a mutual-exclusion lease

lease
Idempotent

Mutual exclusion so two instances of the same agent do not both process one item. Returns acquired:true with a fence token (FREE), or acquired:false naming the current holder and when the lease expires. ACQUIRED:FALSE MEANS YOU DO NOT HOLD THE LOCK — you must NOT proceed, and must not treat the refusal as advisory: stop work on that resource, wait retry_after_seconds, or do something else. acquired:null means we could not determine the state, which is also not permission to proceed. YOU ARE GIVEN TWO NUMBERS AND THEY DO DIFFERENT JOBS. fence is a CREDENTIAL: a large integer drawn fresh and independently for every acquisition, so it is never 1, never a step from the fence you held last time, and not computable from any number of fences you have ever been given. Treat it as a secret — it is the one thing that tells you apart from another instance using your holder label. generation is the ORDER: a counter that strictly increases on every fresh acquisition and never resets, not on expiry and not on release. It is not a secret, it is the number to compare and the number to hand to an external store that must reject stale writers. A revived holder from an earlier generation therefore cannot renew or release a lease someone else now holds — not because its number is smaller, but because it does not have the new one. RE-ACQUIRING A LEASE YOU HOLD IS A RENEWAL ONLY IF YOU PRESENT ITS fence — a holder LABEL is not proof, because two instances of the same agent are exactly the callers most likely to share one, and we will not hand the same lock to both. A live lease requested under its own label without the fence is REFUSED with acquired:false, same_holder_label:true and held_by, never silently renewed. A renewal keeps your fence and stays free. $0.002 is charged the first time you are refused by a given holder; being refused again by the SAME holder is free. Costs $0.002 USDC per call via x402 on Base, and ONLY when acquired === false, and this refusal by this holder has not been billed before; otherwise the same call returns the full answer and settles nothing. Authenticate with Authorization: Bearer , or pass agent_key as an argument if your host cannot set headers. Equivalent HTTP route: POST /v1/lease.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesResource being locked. Namespace-scoped, hashed before storage. Example: 'queue/orders'.
fenceNoOptional: the fence token you were given for this key. Supply it to RENEW the lease you already hold. Omit it and a live lease is refused rather than renewed, because a holder label alone cannot tell you apart from another instance using the same one. It is a CREDENTIAL, not a counter: each acquisition draws an independent large integer, so it is never 1, never the last one plus one, and cannot be computed from any fence you have held before. The value below is a shape, not a value that will work. Example: '3170294857216913'.
scopeNoOptional unit of work, so resume_packet can report the leases you still hold. IT IS ALSO WHAT MAKES THIS LEASE RECOVERABLE: a dead-man switch releases only leases recorded against a scope, so a lease taken without one is invisible to it and a dead holder's lock will block the work for the lease's full TTL. Pass it on every lease you want a switch to be able to give back. Example: 'permit-review-2026-08'.
holderYesWho is asking — an instance id you choose. Required, and it MUST BE UNIQUE PER LIVE INSTANCE: two concurrently running copies that send the same holder are two different callers, and only one of them can hold the lock. Use a per-process value (a uuid, a pod name), not a role name every replica shares. Example: 'worker-3-6f2a91'.
agent_keyNoYour agent_secret, if your MCP host cannot set the Authorization header. Prefer the header.
ttl_secondsNoLease lifetime. Default 60, max 3600. Example: '60'.

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint:false, idempotentHint:true, destructiveHint:false), the description adds crucial behavioral context: the fence is a credential, generation is an order counter, refusal is billed per holder, and the tool authenticates via Bearer header or agent_key. It also warns that acquired:null is not permission to proceed, which is not captured in any annotation.

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 description is long, but it front-loads the most critical warning ('ACQUIRED:FALSE MEANS YOU DO NOT HOLD THE LOCK') and every sentence carries significant information. There is slight repetition around not proceeding on refusal, but given the safety-critical nature, the extra length is justified.

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

Completeness5/5

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

The tool has no output schema, so the description carries the full burden of explaining return values; it does so thoroughly, covering acquired states, fence/generation, same_holder_label, held_by, and retry_after_seconds. It also addresses authentication, billing, edge cases (null state), and interaction with external stores.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds substantial meaning beyond the schema. It explains why holder must be unique per live instance, what scope does for recoverability, how fence functions as a credential for renewal, and how agent_key relates to Authorization. Each parameter's purpose and usage are greatly enriched.

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?

The description opens with 'Mutual exclusion so two instances of the same agent do not both process one item', stating the exact purpose and resource. It explicitly describes the return states (acquired:true, acquired:false, acquired:null), distinguishing this lease-acquisition tool from sibling tools like lease_renew and lease_release.

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?

It clearly explains when to use it (mutual exclusion) and what to do when acquired:false ('you must NOT proceed', 'wait retry_after_seconds'). It does not explicitly name alternatives like lease_renew or lease_release for renewal/release, but it does explain that renewal requires the fence, which implies the lease_renew 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.

TDQS

A4/5.0
Disambiguation5/5

Every tool targets a clearly distinct mechanism—barriers, budgets, checkpoints, claims, heartbeats, inboxes, leases, work queues, etc. Even closely related pairs like claim/complete, work_done/inbox_ack, and barrier_status/work_status are explicitly differentiated in their descriptions, so an agent can reliably select the right tool.

Naming Consistency4/5

The dominant pattern is object_verb (e.g., checkpoint_get, work_push, seen_add, lease_release), which is consistent and readable. A few single-word verbs (claim, complete, send) and noun-only names (resume_packet, retry_state, whoami) break the pattern, but they are few and still intuitive.

Tool Count2/5

With 33 tools, the surface is well beyond the 25-tool threshold for 'too many' and will feel heavy for agents to explore, even though the tools are organized into subdomains. The scope is broad, but the sheer number makes the server less approachable and increases the chance of misselection.

Completeness5/5

The tool set provides thorough lifecycle coverage across its domains: checkpoints get/put, work queue push/take/done/fail/status, inbox poll/ack/nack/schedule, lease acquire/renew/release, barrier create/signal/status, dedup add/check, watermark get/set, retry state, budget check/record, and idempotency claim/complete. There are no obvious dead ends or missing essential operations.

Resources