Skip to main content
Glama

wait_for

Read-only

Pauses automation until a target element appears, or until it disappears when gone is true, so scripts can synchronize with dynamic UI changes.

Instructions

Waits until an element appears (or disappears with gone=true).

Input Schema

NameRequiredDescriptionDefault
xNoViewport x in CSS px (same as screenshot pixels at the default scale).
yNoViewport y in CSS px.
nthNoPick the nth match (0-based) when several match.
refNoRef from the last `snapshot` (e.g. "e12"). Most reliable.
goneNo
textNoVisible text or label of the element (case-insensitive substring).
exactNoWith `text`: require the whole label to match.
withinNoSelector of a container to search in (e.g. a modal).
selectorNoCSS selector. Searches inside every shadow root; use " >>> " to step into a specific shadow root.
timeoutMsNoDefault 10000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations declare readOnlyHint=true, and the description is consistent with a non-mutating poll. It discloses the appear/disappear duality, but says nothing about blocking duration, whether it polls, or what happens on timeout even though timeoutMs is a parameter.

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?

A single short sentence, front-loaded with the core action and the only modifier that changes semantics. Nothing is wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Ten parameters, a 10s default timeout, and no output schema — yet the description never states what a successful wait returns (element? ref?) or how failure is surfaced. For a blocking tool with no output schema, an agent cannot infer result handling from the description alone.

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 90%, so the schema carries most parameter meaning and the baseline is 3. The description does add meaning for 'gone', the one parameter with no schema description, by tying it to disappearance, but says nothing about locator precedence (ref vs selector vs text) across the other nine.

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 ('waits until an element appears') plus the inverse condition via gone=true. It is clearly distinct from query/snapshot/state siblings because it blocks until a condition holds, though no sibling is named explicitly.

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

Usage Guidelines2/5

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

The only guidance is 'or disappears with gone=true' — a parameter note, not usage guidance. Nothing says when to prefer wait_for over query or snapshot, when it is unnecessary, or what to do after it resolves.

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