Skip to main content
Glama

WritersLogic agent-infra

lease

Short lease with fencing tokens: claim a task for N seconds, renew, release — Lets many agents agree which one works on a task: acquire a named resource for 1-3600 s, renew it while working, release it when done. Every new acquisition returns a strictly larger fencing token; pass it to the downstream store and reject writes carrying a smaller one, so a paused holder whose lease expired cannot clobber its successor. Re-acquiring as the current holder extends the lease with t

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>",
      "resource": "<resource>"
    },
    "name": "lease"
  }
}

Input Schema

NameRequiredDescriptionDefault
opYes
tokenNoFencing token from acquire; required for renew and release.
holderNoYour worker id. Required for acquire, renew and release.
resourceYesTask or resource name, e.g. invoice:INV-1009 or deploy:prod.
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).
ttlSecondsNoLease length; default 30.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/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 the monotonic fencing-token contract, that a paused holder with an expired lease cannot clobber its successor, and that re-acquisition extends the lease. It omits error behavior (e.g. NO_HOLD) and what acquire returns, 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.

Conciseness3/5

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

The core contract is front-loaded and dense with useful detail, but the text is truncated mid-sentence ('extends the lease with t'), leaving an incomplete thought, and the opening repeats the acquire/renew/release cycle twice.

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

Completeness3/5

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

For a 7-parameter mutation tool with no annotations and no output schema, the description covers the fencing model and ttl well but never mentions the 'get' op in the enum, nor what acquire returns (token, expiry) or the failure modes an agent must handle. Those are material gaps for correct invocation.

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 already 86%, so the baseline is 3; the description adds real meaning on top by explaining the fencing token's role and the 1-3600 s ttl bound. It does not explain the 'get' op or the holder/tenantId interplay beyond what the schema states.

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 names a specific verb set and resource: 'claim a task for N seconds, renew, release' and 'acquire a named resource for 1-3600 s'. It also states the underlying purpose (letting many agents agree which one works on a task), so an agent can tell exactly what the tool does 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?

It gives clear usage context: acquire before working, renew while working, release when done, and re-acquiring as the current holder extends the lease. It does not name alternatives or exclusions, but the guidance on when each op applies is explicit enough to act on.

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