Skip to main content
Glama

ui_wait_for

Wait for a UI condition—element visible, hidden, enabled, detached, or text present—and return the moment it holds, with a clear page-state report instead of a generic timeout.

Instructions

Block until the page reaches a state: an element appears, disappears, becomes enabled, or some text shows up. This is the honest alternative to guessing a sleep — it returns as soon as the condition holds, and when it does not, it says what the page looked like instead of just timing out.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nthNoWhich match to use when several qualify, 0-based.
roleNoNarrow the matches to this ARIA role.
textNoVisible text on the control. Matches the innermost element that carries it, and follows a <label> to its input.
exactNoRequire the whole text to match rather than a substring.
frameNo'main' (default) or a substring of a frame's origin/name. Single-page apps often render the screen you want in a child frame.main
stateNoWhat to wait for: 'visible' (default), 'hidden', 'enabled', 'detached', or 'stable' (present and no longer moving).visible
testidNoValue of a test attribute (data-testid and friends — see the testAttributes setting).
selectorNoCSS selector. Descends into open shadow roots.
timeout_msNoHow long to wait for the element to become actionable before giving up.
contains_textNoAlso require the element to contain this text.
Install Server

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so well. It discloses that the tool blocks, resolves as soon as the condition holds, and reports what the page looked like on failure rather than silently timing out. This gives the agent an accurate model of runtime behavior without needing an output schema.

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 accomplish a lot: the first states the core behavior and the conditions, the second adds the key value proposition and failure-mode transparency. Every sentence earns its place, and the most important information is front-loaded.

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

Completeness5/5

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

Despite having 10 parameters, the schema thoroughly documents each one, including defaults, enums, and semantic descriptions. The prose description adds the behavioral context that is missing from the schema: blocking semantics, immediate return on success, and informative failure behavior. Nothing essential is left unexplained.

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 the input schema already documents every parameter in detail. The description adds high-level intent but no parameter-specific meaning beyond what the schema provides, so the baseline score of 3 is appropriate.

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 names a specific action ('Block until the page reaches a state') and spells out the conditions it waits for: appearing, disappearing, becoming enabled, or text showing up. It clearly differentiates this from sibling tools like ui_click or network_wait_for_request by grounding it in UI element state.

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 explicitly positions itself as the 'honest alternative to guessing a sleep', which tells the agent when to use it. It stops short of naming sibling alternatives such as network_wait_for_request for network conditions or dom_query for one-shot checks, so exclusions are not fully spelled out.

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

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dayananda-D/Devcdp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server