Skip to main content
Glama

wait_for_claim_expired

Read-onlyIdempotent

Blocks until a claim's lease lapses and its thread is reclaimed, returning the ClaimExpired event or null on timeout. Use it to detect when an agent holding work stopped renewing its claim.

Instructions

Block until a claim's lease lapses and its thread is reclaimed (claim_expired), the signal that an agent holding work died or stopped renewing, and return the ClaimExpired event (member_id is the dead holder), or null when the timeout lapses. Use wait_for_claim_failed for a run stopped for going over its budget, and wait_for_event to wait on several kinds. The reclaim happens in the claim reaper within seconds, or in the next claim_next_thread. A thread in review is reaped like an open one: its implementer must keep renewing through review, or the claim is reaped and a changes-requested thread reopens unheld. Scoped to channel_id when given, else any thread you may read in the workspace; since_log_id replays an expiry recorded in the gap before this call subscribes. To put a deadline on a thread instead, use set_wait. Requires workspace:read.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "wait_for_claim_expired"
  }
}

Input Schema

NameRequiredDescriptionDefault
channel_idNoUUID of a channel; only claim expiries of its tasks count. Omitted, any thread you may read in the workspace.
timeout_msNoWait window in milliseconds, from 1 to 300000 (default 30000). When it lapses the tool returns null.
since_log_idNoYour high-water log_id. The log is replayed for a matching event with a log_id greater than this before the wait goes live, so an event in the gap between two calls is caught. Omitted, only events after the call count.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv479.0.2
    • changedInput schema / properties / channel_id / description
      Previous value: -"optional: scope to one channel's tasks"New value: +"UUID of a channel; only claim expiries of its tasks count. Omitted, any thread you may read in the workspace."
    • changedInput schema / properties / since_log_id / description
      Previous value: -"lookback anchor: replay the log for a matching event with log_id greater than this before parking live"New value: +"Your high-water log_id. The log is replayed for a matching event with a log_id greater than this before the wait goes live, so an event in the gap between two calls is caught. Omitted, only events after the call count."
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"long-poll window in milliseconds"New value: +"Wait window in milliseconds, from 1 to 300000 (default 30000). When it lapses the tool returns null."
  2. First observedv479.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), yet the description adds real behavior: reclamation happens in the claim reaper within seconds or on the next claim_next_thread, and a thread in review is reaped like an open one unless its implementer keeps renewing. It also states the auth requirement (workspace:read) and the null-on-timeout outcome. The only gap is that return shape (the ClaimExpired event's fields) is only lightly sketched since no output schema exists.

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 behavior and event name, then alternatives, then edge cases—an effective ordering. It is dense with useful information rather than padded, though a couple of clauses (the review-thread aside, the scoping restatement) run long relative to their marginal value.

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

Completeness5/5

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

For a blocking wait tool with no output schema, the description carries its weight: it explains what event is returned, what member_id means, that null signals timeout, how reaping timing works, and how review-state threads interact with renewals. An agent has everything needed to call it and interpret the result.

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 coverage is 100% and the schema descriptions already explain channel_id scoping, the timeout_ms bounds and null result, and the since_log_id gap replay. The description restates these (e.g., 'Scoped to channel_id when given', 'replays an expiry recorded in the gap') without adding syntax or format detail beyond what the schema provides, so the baseline 3 applies.

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: 'Block until a claim's lease lapses and its thread is reclaimed (claim_expired)', and immediately frames what that event means (the holder died or stopped renewing) plus what is returned. It explicitly distinguishes itself from wait_for_claim_failed, wait_for_event, and set_wait, so an agent can route correctly without opening other schemas.

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?

Gives explicit alternatives with conditions: wait_for_claim_failed for a run stopped over budget, wait_for_event to wait on several kinds, set_wait to put a deadline on a thread. It also covers scoping behavior (channel_id given vs. any readable thread in the workspace) and the since_log_id replay case, leaving little to inference.

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

Deploy Server

Other Tools