Skip to main content
Glama

rex_wait

Waits for a terminal block to exit or its output to match a JavaScript regex, returning completion, timeout, exit code, or match data. Use it to synchronize automation with running commands.

Instructions

Wait on a block. until: exit waits for the terminal's program to exit; until: match polls the capture for pattern (a JS regex). Returns {done, timed_out, exit_code?, match?}.

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": {
      "block": "<block>",
      "until": "<until>"
    },
    "name": "rex_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
blockYesBlock label, ID, or ID suffix
untilYes
patternNo
sessionNoSession label or ID
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that the call blocks, that `match` mode polls the capture, that `pattern` is a JS regex, and it spells out the return fields including `timed_out`. It omits the default timeout, what happens if the block is already gone or the block label is ambiguous, and whether polling consumes or alters capture state.

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?

Three tight sentences: the core action first, then the mode semantics, then the return contract. Every clause carries information and nothing is repeated from the schema.

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 five-parameter blocking tool with no annotations and no output schema, the description gives enough to invoke it correctly in both modes and to interpret the response fields. The remaining gap is operational edge cases: default timeout and error or already-exited behavior.

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 only 40%, so extra meaning is needed; the description does explain the `until` enum values and clarifies that `pattern` is a JavaScript regex rather than a literal string, which the schema leaves untyped beyond 'string'. It says nothing about `session` or `timeout_seconds`, and the 3600s cap and exclusive minimum are left entirely to the schema.

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 ('Wait on a block') and immediately splits the tool into its two operating modes, `until: exit` versus `until: match`, so an agent knows what the tool does. It stops short of differentiating itself from siblings such as rex_events_poll or rex_capture, which also observe terminal 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?

The description implies when each mode is appropriate (exit for program termination, match for output patterns), which is useful implicit guidance. However, it never says when to prefer this over polling events or capturing output with a sibling tool, and it lists no prerequisites or failure preconditions.

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