Skip to main content
Glama

Agent Billing Primitives (Dirtsmith)

agent_lease_lock

agent_lease_lock

Distributed lock / lease lock (mutex) for AI agents: acquire, renew, release a named lock with TTL and a monotonic fencing token so only one agent runs a job at a time. Idempotent, shared by namespace, no Redis needed. Every call requires a tiny solved packet (returned in the reply, 2 s, one try); free first call, no API key (GET /try?tool=agent_lease_lock).

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": {
      "namespace": "<namespace>",
      "action": "<action>",
      "lock_name": "<lock_name>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "agent_lease_lock"
  }
}

Input Schema

NameRequiredDescriptionDefault
ttl_sNo
actionYes
sourceNo
caller_idNodemo_caller
holder_idNo
lock_nameYes
namespaceYes
idempotency_keyYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full load and does well: it discloses idempotency, TTL-bounded leases, a monotonic fencing token, namespace-scoped sharing, no external Redis dependency, and a per-call proof-of-work requirement (a solved packet, 2 s, one try). That is unusually rich behavioral context for a mutation tool. Gaps remain: it does not say what happens when the lock is already held (error vs. wait), whether renew extends TTL from now or from expiry, or that release/renew likely require holder_id.

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 purpose is front-loaded in the first clause, which is good, but the rest is a dense run-on mixing core semantics with access logistics. The trailing parenthetical about the free first call and GET /try endpoint reads as promotion and would be better as a short separate note. Nothing is grossly redundant, but the packing hurts scannability.

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 an 8-parameter, unannotated, no-output-schema mutation tool, the definition covers the concept well but leaves operational essentials implicit. Missing are conflict/error behavior, the meaning of the fencing token in the response, and the identity parameters needed to safely renew or release. An agent could form a rough call but would likely get renew/release semantics wrong on the first attempt.

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

Parameters2/5

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

Schema description coverage is 0% across 8 parameters, so the description must compensate and largely does not. It explains TTL and three of the four action values, and hints at namespace scoping and idempotency, but the required holder_id, caller_id, source and the status action get no meaning at all. The fencing token is described as a concept yet is not tied to any parameter or return value, leaving the agent to guess how holder identity is passed on renew and release.

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 names a specific resource and mechanism: a distributed mutex/lease lock with acquire, renew and release, TTL and a fencing token, plus the goal 'only one agent runs a job at a time'. It is clearly a locking tool rather than a registry or ledger. It never distinguishes itself from the closest sibling, agent_semaphore, so an agent cannot tell mutex from counting semaphore from the description alone.

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 by 'so only one agent runs a job at a time', which gives the reader a mental model of when to reach for it. There is no explicit when-not-to-use, no guidance on choosing between acquire/renew/release/status, and no routing to agent_semaphore or agent_heartbeat_registry. The onboarding note (free first call, GET /try) is access guidance rather than tool-selection guidance.

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.