Skip to main content
Glama

wait_for

Block until one agent_id or every agent in ids reaches a target registry state and return health. Defaults to waiting for completion (done).

Instructions

Block until one agent_id or every agent in ids reaches a target registry state and return health. Defaults to waiting for completion (done).

Input Schema

NameRequiredDescriptionDefault
idsNoAgent IDs to wait for together
mineNoWait for every direct child of the calling agent
watchNoDeclared WatchSpec alternative to agent_id/ids
agent_idNoSingle agent ID from spawn_agent
conditionNoAlias for target_state
timeout_msNoTimeout in milliseconds (default: 5 minutes)
delivery_idNoWait for a send_to delivery_id to reach a terminal outcome
done_markerNoFinal-line marker for report_path
report_pathNoWith done_marker and agent_id: file-backed done. Matches when this ABSOLUTE file's final non-empty line equals done_marker, the same report contract spawn_agent issues. After symlinks resolve it must be a regular file (max 1 MiB) under ~/.cmux/agents/<agent_id>/ or ~/.cmux/live-harness/, else refused. An agent in error never matches.
target_stateNoState to wait for

Output Schema

NameRequiredDescriptionDefault
okYes
typedNo
watchNo
resultsNo
agent_idNo
deliveryNo
terminalNo
deliveredNo
timed_outNo
delivery_idNo
retry_countYes
rpc_methodsNo
duplicate_ofNo
delivery_stateNo
needs_attentionNo
submit_evidenceNo
submit_verifiedNo
attention_reasonNo
submit_attemptedNo
submit_dispatchedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.4.106
    • changedOutput schema / properties / delivery / enum
      Previous value: -[
      -  "submitted",
      -  "typed",
      -  "queued",
      -  "queued_followup",
      -  "rescued",
      -  "failed",
      -  "pending_verify",
      -  "failed_confirmed",
      -  "stalled_queue"
      -]New value: +[
      +  "submitted",
      +  "typed",
      +  "queued",
      +  "steer_pending",
      +  "queued_followup",
      +  "rescued",
      +  "failed",
      +  "pending_verify",
      +  "failed_confirmed",
      +  "stalled_queue"
      +]
    • changedOutput schema / properties / delivery_state / enum
      Previous value: -[
      -  "submitted",
      -  "typed",
      -  "queued",
      -  "queued_followup",
      -  "rescued",
      -  "failed",
      -  "pending_verify",
      -  "failed_confirmed",
      -  "stalled_queue"
      -]New value: +[
      +  "submitted",
      +  "typed",
      +  "queued",
      +  "steer_pending",
      +  "queued_followup",
      +  "rescued",
      +  "failed",
      +  "pending_verify",
      +  "failed_confirmed",
      +  "stalled_queue"
      +]
  2. Changed1 schema field changedv0.4.89
    • changedInput schema / properties / report_path / description
      Previous value: -"With done_marker and agent_id: file-backed done. Matches when this ABSOLUTE file's final non-empty line equals done_marker, the same report contract spawn_agent issues. After symlinks resolve it must sit under ~/.cmux/ or ~/.cmux/agents/<agent_id>/, else refused."New value: +"With done_marker and agent_id: file-backed done. Matches when this ABSOLUTE file's final non-empty line equals done_marker, the same report contract spawn_agent issues. After symlinks resolve it must be a regular file (max 1 MiB) under ~/.cmux/agents/<agent_id>/ or ~/.cmux/live-harness/, else refused. An agent in error never matches."
  3. Changed10 schema fields changedv0.4.88
    • changedInput schema / properties / agent_id / description
      Previous value: -"Agent ID from spawn_agent"New value: +"Single agent ID from spawn_agent"
    • addedInput schema / properties / condition
      Added value: +{
      +  "description": "Alias for target_state",
      +  "enum": [
      +    "ready",
      +    "working",
      +    "idle",
      +    "done",
      +    "error"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / delivery_id
      Added value: +{
      +  "description": "Wait for a send_to delivery_id to reach a terminal outcome",
      +  "type": "string"
      +}
    • addedInput schema / properties / done_marker
      Added value: +{
      +  "description": "Final-line marker for report_path",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / ids
      Added value: +{
      +  "description": "Agent IDs to wait for together",
      +  "items": {
      +    "type": "string"
      +  },
      +  "minItems": 1,
      +  "type": "array"
      +}
    • addedInput schema / properties / mine
      Added value: +{
      +  "default": false,
      +  "description": "Wait for every direct child of the calling agent",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / report_path
      Added value: +{
      +  "description": "With done_marker and agent_id: file-backed done. Matches when this ABSOLUTE file's final non-empty line equals done_marker, the same report contract spawn_agent issues. After symlinks resolve it must sit under ~/.cmux/ or ~/.cmux/agents/<agent_id>/, else refused.",
      +  "type": "string"
      +}
    • addedInput schema / properties / watch
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Declared WatchSpec alternative to agent_id/ids",
      +  "properties": {
      +    "change": {
      +      "const": "content",
      +      "description": "Persistent file-content change watch; mutually exclusive with predicate and marker",
      +      "type": "string"
      +    },
      +    "deadline": {
      +      "description": "Absolute Unix deadline in milliseconds",
      +      "exclusiveMinimum": 0,
      +      "type": "integer"
      +    },
      +    "marker": {
      +      "description": "Literal file marker; mutually exclusive with predicate and change",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "notify": {
      +      "description": "Opt in to the configured external notification transport",
      +      "type": "boolean"
      +    },
      +    "owner": {
      +      "description": "Agent/seat notified by the watch",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "predicate": {
      +      "description": "Agent screen-state predicate: thinking, working, idle, done, error; mutually exclusive with marker and change",
      +      "enum": [
      +        "thinking",
      +        "working",
      +        "idle",
      +        "done",
      +        "error"
      +      ],
      +      "type": "string"
      +    },
      +    "target": {
      +      "description": "Absolute file path or public agent_id",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "watermark": {
      +      "description": "Prior marker count; defaults to count observed at arm time",
      +      "minimum": 0,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "owner",
      +    "target",
      +    "deadline"
      +  ],
      +  "type": "object"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "agent_id",
      -  "target_state"
      -]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "agent_id": {
      +      "type": "string"
      +    },
      +    "attention_reason": {
      +      "type": "string"
      +    },
      +    "delivered": {
      +      "type": "boolean"
      +    },
      +    "delivery": {
      +      "enum": [
      +        "submitted",
      +        "typed",
      +        "queued",
      +        "queued_followup",
      +        "rescued",
      +        "failed",
      +        "pending_verify",
      +        "failed_confirmed",
      +        "stalled_queue"
      +      ],
      +      "type": "string"
      +    },
      +    "delivery_id": {
      +      "type": "string"
      +    },
      +    "delivery_state": {
      +      "enum": [
      +        "submitted",
      +        "typed",
      +        "queued",
      +        "queued_followup",
      +        "rescued",
      +        "failed",
      +        "pending_verify",
      +        "failed_confirmed",
      +        "stalled_queue"
      +      ],
      +      "type": "string"
      +    },
      +    "duplicate_of": {
      +      "type": "string"
      +    },
      +    "needs_attention": {
      +      "type": "boolean"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "results": {
      +      "items": {
      +        "additionalProperties": {},
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "retry_count": {
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "rpc_methods": {
      +      "items": {
      +        "enum": [
      +          "surface.send_text",
      +          "surface.send_key"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "submit_attempted": {
      +      "type": "boolean"
      +    },
      +    "submit_dispatched": {
      +      "type": "boolean"
      +    },
      +    "submit_evidence": {
      +      "anyOf": [
      +        {
      +          "enum": [
      +            "token_delta",
      +            "transcript_echo",
      +            "cleared_composer",
      +            "status_only"
      +          ],
      +          "type": "string"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "submit_verified": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "terminal": {
      +      "type": "boolean"
      +    },
      +    "timed_out": {
      +      "type": "boolean"
      +    },
      +    "typed": {
      +      "type": "boolean"
      +    },
      +    "watch": {
      +      "additionalProperties": {},
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "ok",
      +    "retry_count"
      +  ],
      +  "type": "object"
      +}
  4. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

The description usefully discloses blocking semantics and that health is returned, which the annotations (readOnlyHint=false, idempotentHint=false) do not convey. It omits what happens on timeout, whether a timeout is an error or a normal return, and that the input is a set of mutually exclusive modes. No contradiction with the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

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

Two tight sentences, front-loaded with the blocking verb and scope, with no filler. Every sentence earns its place.

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

Completeness2/5

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

For a 10-parameter tool with a nested WatchSpec and multiple mutually exclusive wait modes, the description accounts for only the agent-state mode. A caller cannot learn from it that file-marker watches, delivery-outcome waits, or file-backed done markers exist, so it is materially incomplete even though an output schema exists.

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 100%, so the 10 parameters are already documented in the schema and the baseline is 3. The description echoes agent_id/ids/target_state but adds no meaning beyond the schema, and says nothing about the nested watch object or the delivery_id/report_path alternatives.

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 ('Block until') and resource (an agent_id or every agent in ids reaching a target registry state) plus the default target of 'done'. However, it only describes one of the several wait modes the schema exposes (watch, delivery_id, report_path), so it under-describes the tool's actual scope.

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

Usage Guidelines2/5

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

The only usage information is the implicit default ('Defaults to waiting for completion'), which is already carried by the target_state default in the schema. It never says when to prefer this over sibling approaches such as list_agents or read_screen, nor when not to use it.

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