Skip to main content
Glama

Wait for a panel to be ready

cmux_wait_ready

Poll a terminal surface until it matches a regex or becomes stable, then return the final screen; use after spawning a panel instead of sleeping.

Instructions

Poll a surface until ready, then return the final screen. Ready = matches pattern regex, or (no pattern) the screen is non-empty and unchanged between polls. Use instead of sleeping after spawning a panel; for a live TUI that never settles, pass a pattern.

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": {
      "surface": "<surface>"
    },
    "name": "cmux_wait_ready"
  }
}

Input Schema

NameRequiredDescriptionDefault
windowNoWindow ref like "window:1". Defaults to the caller's window.
patternNoRegex; ready as soon as the screen matches it.
surfaceYesSurface/panel ref to watch, e.g. "surface:39".
timeoutMsNoGive up after this long (default 15000).
workspaceNoWorkspace ref like "workspace:26". Defaults to the caller's workspace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.13

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden; it discloses the polling model, both readiness conditions, and that the final screen is returned. It does not say what happens on timeout (error? partial screen?), how often it polls, or whether the call blocks, which are the key risks for a waiting tool.

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 with zero filler. The core action and return value come first, the readiness definition follows, and the usage advice lands last as a directive.

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?

There is no output schema, and the description correctly states the return value; it also covers the two readiness modes an agent must reason about. The one meaningful gap is timeout/failure behavior, which is undocumented in both the description and the schema beyond the default value.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning: `pattern` changes the readiness predicate itself and is the required escape hatch for never-settling TUIs. `surface`, `window`, `workspace`, and `timeoutMs` 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?

The description opens with a specific verb and resource ("Poll a surface until ready") and states the return value ("return the final screen"), then defines "ready" precisely in two modes. It distinguishes the tool from sleeping and from a plain capture by naming the readiness predicate, though it never names a sibling tool explicitly.

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?

It gives an explicit when-to-use ("Use instead of sleeping after spawning a panel") plus a conditional branch for a specific situation ("for a live TUI that never settles, pass a `pattern`"). It lacks an explicit when-not-to-use or a named alternative such as cmux_capture for one-shot screen grabs.

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