Skip to main content
Glama

lease_acquire

Acquire a named lease on shared state such as a checkout, dev database, or port without blocking; retake it to extend, or set wait to queue FIFO and receive a grant wake.

Instructions

Try to take a named lease on state another session could also change, such as a shared checkout, a dev database or a port (non-blocking). Re-taking your own lease extends it. With wait:true, queue FIFO on a held lease and receive one wake when granted; the requested TTL starts at grant time, and max_wait_seconds defaults to 3600. The caller must have a safe running session that can receive wakes. lease_release cancels your queued wait. The grant wake reports a deadline that may pass before delivery; call lease_acquire again before then to extend it. A worker's leases are released when hive stops its pane, parks it or confirms it dead; row_only retirement leaves them in place because it does not stop the pane. Leases expire on their own.

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": {
      "key": "<key>",
      "ttl_seconds": "<ttl_seconds>"
    },
    "name": "lease_acquire"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesStable and specific, like "db:dev".
waitNo
project_idNoDifferent project override. Use ONLY when the user explicitly asks for another project by name; otherwise stay in the current scope, even when results are empty.
ttl_secondsYes
max_wait_secondsNo

Output Schema

NameRequiredDescriptionDefault
keyYes
queuedNo
held_byNo
acquiredYes
extendedNo
positionNo
expires_atNo
project_idYes
hive_noticeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.15.2
    • addedInput schema / properties / max_wait_seconds
      Added value: +{
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
    • addedInput schema / properties / wait
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / position
      Added value: +{
      +  "exclusiveMinimum": 0,
      +  "maximum": 9007199254740991,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / queued
      Added value: +{
      +  "const": true,
      +  "type": "boolean"
      +}
  2. Changed1 schema field changedv1.4.0
    • changedInput schema / properties / key / description
      Previous value: -"Stable and specific, like \"file:src/api/routes.ts\"."New value: +"Stable and specific, like \"db:dev\"."
  3. Changed1 schema field changedv1.2.2
    • addedOutput schema / properties / hive_notice
      Added value: +{
      +  "type": "string"
      +}
  4. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare it is a non-readonly, non-destructive, non-idempotent operation; the description goes far beyond that with the extension semantics of re-taking a lease, TTL start-at-grant, the max_wait_seconds default of 3600, the single-wake-per-grant rule, and the wake-deadline caveat. It also discloses lifecycle behavior an agent cannot infer: leases are released when hive stops/parks the pane or confirms it dead, row_only retirement leaves leases in place, and leases expire on their own.

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?

Front-loaded with the core action and mode, then progressively finer detail about waits, wakes and release conditions. It is dense but nearly every clause carries operational meaning; the hive pane-retirement sentence leans on internal jargon and is the one part an outside caller would have to decode.

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?

An output schema exists, so return values need no explanation, and the description covers timing, queueing, extension and release behavior thoroughly for a lease primitive. The main omission is what a non-blocking failure looks like (whether the call reports 'held' versus erroring), which an agent needs in order to decide between wait:true and retrying.

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 only 40%, so the description has to compensate, and it does for the important ones: wait:true queueing, max_wait_seconds defaulting to 3600, and ttl_seconds measured from grant time rather than request time. project_id is left to the schema's own scoping warning, which already covers it, so the remaining gap is minor.

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?

States a specific verb and resource ('take a named lease on state another session could also change') and grounds it with concrete examples (shared checkout, dev database, port). It also distinguishes itself from the sibling lease_release by stating that lease_release cancels a queued wait, so an agent can separate the two without opening either 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?

Explicit about the two modes: non-blocking by default, and queueing FIFO with wait:true. It names the prerequisite ('caller must have a safe running session that can receive wakes'), tells the agent when to re-call ('call lease_acquire again before then to extend it'), and points at lease_release as the cancellation path.

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