Skip to main content
Glama

lock_acquire

Acquire a named lock for an owner with a TTL so agents can take turns on shared files, devices, or jobs; existing live locks return the holder and release time, and held locks renew.

Instructions

Take a named lock for your owner label, for ttl_minutes. Use a lock when agents must take turns around one file, one device or one job. If a live lock with that name exists, you get an answer naming the holder and the time it frees. A lock you already hold is renewed. Expired locks free themselves. Fractional minutes are allowed for short locks.

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": {
      "name": "<name>",
      "owner": "<owner>"
    },
    "name": "lock_acquire"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes
ownerYes
ttl_minutesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/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 load and does it well: it discloses contention behavior (you get an answer naming the holder and the free time), renewal semantics for a lock you already hold, self-expiry of stale locks, and that fractional minutes are permitted. It omits whether the call blocks or returns immediately and any permission/auth requirements, keeping it below 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.

Conciseness4/5

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

Five short sentences, front-loaded with the action and TTL, then usage, then edge-case behavior. Each sentence adds information; only minor tightening is possible, e.g. merging the renewal and expiry sentences.

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 3-parameter tool with no annotations and no output schema, the description covers the important unknowns: what happens on contention (effectively the return path), renewal, and expiry. The only material gap is the default TTL and whether the caller must retry rather than wait.

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 0%, so the description must compensate and largely does: name is a lock identifier, owner is the holder label, ttl_minutes is the lease duration with fractional values allowed. The default of 15 minutes is only in the schema and is not restated, and the owner format is unspecified.

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?

Opens with a specific verb+resource: "Take a named lock for your owner label, for ttl_minutes." The scoping phrase "for your owner label" and the naming of the lock distinguish it from lock_release/lock_list without needing the sibling list. It stops short of explicitly contrasting with the release/list siblings, so a 4 rather than a 5.

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?

"Use a lock when agents must take turns around one file, one device or one job" gives a concrete selection rule with example resources. It does not state when not to use it or name lock_release as the paired follow-up, so guidance is clear but not exhaustive.

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