Skip to main content
Glama

Wait for Codex Agents (blocking)

agent_wait
Read-onlyIdempotent

Block execution until one or all subagent workers are ready, then get a lean per-worker status report. Pass every outstanding worker ID in a single call to avoid repeated stalls.

Instructions

Block until watched workers are ready. This blocks your whole turn, so use it only once you have run out of other work — while you still have anything to do, dispatch it and poll with agent_result instead. Workers do not need this call to stay alive or make progress. When you do wait, always pass every outstanding worker in agentIds rather than waiting on one at a time: waiting serially multiplies the stall by the number of workers. Returns when the mode condition is met or the timeout expires, with a lean report for each ready worker and each one still running.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoany (default) returns as soon as one watched worker is ready, so you can start using its result while the rest run. all returns when every watched worker is ready.
untilNoterminal (default) waits for workers to finish, request also returns when one needs an approval answered, change returns on any new event.
agentIdNoSingle-worker shorthand for agentIds.
agentIdsNoWatch a whole fleet in one call. Always prefer this over waiting on workers one at a time.
afterCursorNo
timeoutSecondsNoSeconds to block, default 10. A timeout is not a failure: the workers keep running and the result still reports where each one got to.
Behavior5/5

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

The description discloses significant behavioral traits beyond the annotations: it blocks the entire turn, workers do not need the call to stay alive, serial waiting multiplies the stall, timeout is not a failure, and the return value is a lean report for ready and still-running workers. The idempotentHint and readOnlyHint are consistent with the description, and this extra context is exactly what an agent needs before invoking a blocking call.

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?

The description is dense but every sentence earns its place: the core blocking behavior is front-loaded, usage rules follow immediately, the agentIds guidance is explicit, and the return behavior closes the loop. There is no filler or repetition of the schema's plain parameter descriptions.

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?

For a blocking tool with no output schema, the description covers the essential operational context: when to use it, what happens on timeout, how to batch workers, and what the report contains. The main gap is the undocumented afterCursor parameter, which could matter when paginating events/results over long waits, and which neither the schema nor the description explains.

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?

With 83% schema coverage, the schema already documents most parameters, so the baseline is 3. The description adds value on top by explaining the semantic constraint around agentIds ('always pass every outstanding worker'), the distinction between agentId/agentIds, and the meaning of timeout behavior ('a timeout is not a failure'). However, afterCursor remains undocumented in both the schema and the description, preventing a 5.

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 description names a specific verb ('Block'), a specific resource ('watched workers'), and the defining behavior ('until ... ready'). It also directly distinguishes itself from sibling agent_result ('poll with agent_result instead'), so an agent can tell it apart without opening the sibling 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?

The description gives explicit when-to-use ('only once you have run out of other work'), an explicit alternative with a condition ('while you still have anything to do, dispatch it and poll with agent_result'), and a clear best-practice for parameter usage ('always pass every outstanding worker in agentIds rather than waiting on one at a time'). This fully routes the agent's decision.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/j-pollack/codex-app-server-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server