Skip to main content
Glama

claim

Acquire an advisory lock on a named resource so other agents wait before shared actions like pushes or file edits; locks auto-expire and should be released when done.

Instructions

Take an exclusive advisory lock on a named resource so other agents know to wait. Use for coordinating shared actions — e.g. resource='push:' before you commit & push, or 'file:src/app.py' while rewriting a file.

Succeeds if the resource is free, expired, or already yours (refreshes it). Fails (ok=False) if another agent holds it, telling you who and for how long. The lock auto-expires after ttl_seconds so a crashed agent never deadlocks the bus. Call release when done. Locks are advisory — agents must honor them by convention.

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

Input Schema

NameRequiredDescriptionDefault
noteNo
resourceYes
ttl_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: it specifies the success conditions (free, expired, or already yours, which refreshes), the failure shape (`ok=False` plus holder identity and hold duration), automatic expiry via `ttl_seconds` to avoid deadlock, and that locks are advisory and honored only by convention. That is a complete behavioral contract for a mutation-style tool.

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 core action is front-loaded, examples follow, and the failure/expiry/release details come after in a sensible order. Every sentence carries information, though "Locks are advisory" mildly restates the first sentence's "advisory" and could be merged with the convention note.

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 three-parameter tool with no annotations and no output schema, the definition covers behavior, failure semantics, and lifecycle well. The remaining gaps are the undocumented `note` parameter and an incomplete picture of the success response beyond `ok`, which is a small shortfall rather than a blocking one.

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

Parameters3/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. It does add real meaning for `resource` (the `push:<repo>` and `file:<path>` naming conventions) and explains what `ttl_seconds` controls behaviorally, but it never states the 600-second default, gives no guidance on choosing a TTL, and leaves the `note` parameter entirely unexplained.

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?

"Take an exclusive advisory lock on a named resource" gives a specific verb, resource, and scope in one clause. It immediately distinguishes the tool from its counterpart by noting that the lock must later be freed with `release`, so an agent can place this among the sibling tools without reading any schema.

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

Usage Guidelines5/5

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

It states the coordination use case and backs it with two concrete invocations (`push:<repo>` before commit & push, `file:src/app.py` while rewriting). It also names the required follow-up action ("Call `release` when done"), closing the loop that an agent would otherwise have to guess at.

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