Skip to main content
Glama

Wait for Agent State

agent_wait
Read-onlyIdempotent

Waits for a target agent or pane to reach idle, done, blocked, or a specified state, letting orchestration scripts pause until work settles before continuing.

Instructions

Block until an agent reaches idle, done, blocked (default), or one of the specified 'until' states.

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": {
      "target": "<target>"
    },
    "name": "agent_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
untilNoOptional list of states to match; omit for settled states (idle, done, blocked).
targetYesUnique live agent name or hosting pane ID.
timeout_msNoTimeout in milliseconds (default 120000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds the genuinely useful behavioral trait that the call blocks until a state matches and that the default matches settled states, but it omits what happens on timeout (error, empty result, or last observed state).

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?

A single front-loaded sentence that leads with the blocking behavior and then the state options, with no filler. The parenthetical default is compact rather than wasteful, though the sentence becomes slightly dense by packing three ideas together.

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?

There is no output schema, so the definition should ideally state what a successful wait returns (e.g., the matched state or the timed-out condition), and it does not. Timeout semantics are also undocumented, leaving a real gap for a blocking tool even though the three parameters themselves are well covered elsewhere.

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%, so the schema already documents target, until, and timeout_ms with their defaults. The description's mention of 'until' states largely restates the schema's own enumeration of settled states, adding no new syntax, format, or constraint detail; baseline 3 applies when the schema does the heavy lifting.

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?

States a specific verb and resource ("Block until an agent reaches...") plus the exact state set it can match, which is much clearer than a generic "wait" name. It does not explicitly contrast itself with the similarly named siblings like events_wait or pane_wait_output, so differentiation is left to the words "agent" and "state".

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 only implied: an agent should call it when it needs to block on agent state. There is no explicit when-not guidance, no advice on choosing the 'until' list versus relying on the default, and no mention of when a polling alternative would be preferable.

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