Skip to main content
Glama

wait_for

Block execution until monitored terminals finish, need input, or fail, instead of polling in a loop. Waits for one or all terminals, returning on a state change or timeout.

Instructions

Block until a terminal finishes, asks something or dies -- instead of polling.

This holds your conversation until it returns. From Claude Code, prefer a background watch on GET /events (see the maestro skill) so the user can keep talking to you; use this for scripts, or with a short timeout.

Returns as soon as one watched terminal reaches one of states (default: completed, waiting_user_answer, error -- stuck is also available), or when timeout_seconds runs out (max 900). With require_all it waits for every watched terminal instead of the first. terminal_ids defaults to the whole fleet. A terminal with a message still queued counts as busy, not finished.

This is the loop to use while a fleet runs: wait, act on what came back (read its output, answer its question, restart it), wait again. Polling get_terminal_status in a loop costs a call and a turn every few seconds and tells you nothing in between.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statesNo
require_allNo
terminal_idsNo
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so well: it discloses the blocking nature, the max timeout of 900s, the default state set, the require_all semantics, the whole-fleet default for terminal_ids, and the subtle rule that a terminal with a queued message counts as busy rather than finished.

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 purpose and well organized, but the Claude Code / events aside and the closing anti-polling rationale add length beyond the minimum needed. Every sentence is still informative, so only mildly verbose.

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 coordination tool with four optional parameters and an output schema (which covers return values), the description supplies everything an agent needs: semantics, defaults, limits, and the intended usage loop.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it covers all four parameters: the default and available values for states, the max on timeout_seconds, the first-vs-all behavior of require_all, and the whole-fleet default of terminal_ids.

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?

The first sentence states a specific blocking verb and its trigger conditions ('block until a terminal finishes, asks something or dies'), which is exactly what distinguishes it from sibling get_terminal_status. An agent can identify the tool's job without opening the 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?

It explicitly routes between alternatives: prefer a background watch on GET /events from Claude Code, use this for scripts or short timeouts, and avoid polling get_terminal_status in a loop because it 'costs a call and a turn every few seconds.' It even frames the intended loop (wait, act, wait again).

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