Skip to main content
Glama

terminal_wait_for

Polls a terminal session until a regex pattern appears or a timeout is reached, enabling automation to wait for prompts, output, or rendered UI before proceeding.

Instructions

Poll the terminal screen until a regex pattern appears or timeout is reached. Useful for waiting for prompts, output, or UI elements to render.

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": {
      "session_id": "<session_id>",
      "pattern": "<pattern>"
    },
    "name": "terminal_wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
patternYesRegex pattern to search for in the screen content
session_idYesThe session ID returned by terminal_spawn
timeout_msNoMaximum time to wait in ms (default: 10000)
interval_msNoPolling interval in ms (default: 200)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It correctly discloses the polling/blocking model and the timeout mechanism, but is silent on the most consequential behavior: what happens when the timeout elapses — whether it errors, returns a negative result, or returns partial screen content.

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 sentences with no filler, leading with the mechanism and termination condition before the use case. Every phrase earns its place.

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?

For a polling tool with no output schema and no annotations, the description should clarify the return value on match versus timeout and whether the call blocks. It covers the mechanism adequately but leaves the result semantics ambiguous, which matters for an agent writing branching logic around the call.

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 all four parameters including defaults for timeout_ms and interval_ms are already documented in the schema. The description adds no regex syntax guidance, units, or default behavior beyond what the schema states, so the baseline of 3 applies.

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 ('Poll the terminal screen') plus the terminating condition (regex match or timeout), which is precise enough to distinguish it from siblings like terminal_assert or terminal_screenshot. It stops short of naming any sibling explicitly, so an agent must infer the boundary itself.

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

Usage Guidelines4/5

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

The second sentence gives clear usage context: waiting for prompts, output, or UI elements to render. It does not state when NOT to use it (e.g., one-shot checks versus repeated polling, or how it relates to terminal_assert), so no exclusions or alternatives are provided.

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