Skip to main content
Glama

Wait for a widget

wait_for
Read-onlyIdempotent

Waits until a widget matching a selector is on screen, then returns matches. Use it instead of polling the tree when UI elements appear asynchronously.

Instructions

Waits until a widget matching the selector is on screen, and returns the matches. Use this instead of polling tree when something appears asynchronously.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoThe widget's ID, exactly as shown after # in the tree.
nthNoWhich match to use when several qualify, 0-based; negative counts from the end.
roleNoThe semantic role.
labelNoThe label, matched exactly.
valueNoThe current value, matched exactly — for example the selected item of a list.
timeout_msNoHow long to wait, in milliseconds. Defaults to 5000.
label_containsNoA substring of the label, for labels that carry live data.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds the blocking/waiting semantics and that it returns matches, but omits what happens on timeout (empty result vs. error) and whether the wait is measured against a fixed or retrying poll — a meaningful gap for a wait 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 sentences, zero padding, with the behavioral outcome front-loaded and the routing advice second. Every clause carries information.

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?

There is no output schema, so the description carries the burden of describing the return value; 'returns the matches' is suggestive but does not say what a match contains or how many are returned relative to 'nth'. Timeout failure behavior is also left unstated, leaving the definition adequate but incomplete for a 7-parameter wait primitive.

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% across all 7 parameters, so the schema already explains id, nth, role, label, value, timeout_ms and label_contains. The description adds only the generic phrase 'matching the selector' and hints at multiple matches, which justifies the baseline 3 rather than more.

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?

States a specific verb (waits), resource (widget matching the selector), and outcome (returns the matches). It also explicitly distinguishes itself from sibling tooling by naming 'polling tree' as the thing it replaces.

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?

Gives a clear selection condition: use this instead of polling tree for asynchronously appearing widgets. It names an alternative but offers no when-not guidance (e.g., when a synchronous lookup like 'find' is preferable because the widget should already be present).

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

Deploy Server

Other Tools