Skip to main content
Glama

wait_for

Waits for specified text to appear in a Java Swing UI snapshot, or to disappear when gone is true; also waits for the first window after launching an app.

Instructions

Wait until text appears anywhere in the snapshot (or disappears with gone=true). Without text, waits for the first window to appear, which is useful right after launch_app. Returns the snapshot; a timeout is an error, with the snapshot at that moment.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
goneNo
textNo
timeoutMsNoDefault 10000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/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 delivers the important traits: this is a blocking wait, it returns the snapshot, and a timeout is surfaced as an error carrying the snapshot at that moment. It does not disclose polling cadence, matching semantics (substring vs exact vs regex), or whether the wait observes a stale or live snapshot, which matters for a timing-sensitive 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?

Three compact sentences: the primary condition first, the degenerate no-text mode second, and the return/error contract last. Every clause carries information; nothing is repeated from structured fields.

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 explains that the snapshot is returned and included on timeout errors, so the response contract is covered. For a 3-parameter blocking primitive, the remaining gap is the nature of the snapshot payload and match semantics, but an agent can call it correctly as written.

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 only 33% (timeoutMs has the 'Default 10000' note), but the description compensates by defining `text` as 'appears anywhere in the snapshot' and `gone=true` as the disappearance check, plus the empty-text behavior. Only `timeoutMs` semantics beyond the default (units, whether it errors vs returns partial) are left implicit.

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 opens with a specific verb plus condition: wait until `text` appears anywhere in the snapshot, and states the inverse mode (gone=true). It also names the zero-argument mode (wait for the first window) and ties it to a concrete sibling, launch_app, so an agent can tell it apart from snapshot/read_items without opening a schema.

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 explicit context for the no-text mode (use right after launch_app) and defines the two conditional modes for text vs gone. It stops short of stating when to prefer this over calling snapshot directly or what to do when the wait times out (e.g., retry vs fall back), leaving some routing to inference.

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