Skip to main content
Glama

wait_for

Polls for UI elements to appear or disappear after actions trigger changes, supporting flexible matching criteria and timeout control.

Instructions

Wait for elements to appear or disappear.

Polls until matching elements are found (or gone) or timeout.
Use after actions that trigger UI changes.

Args:
    element: Text to search for.  Pass a single string (e.g.
        "Submit") or a list of strings (e.g. ["Success", "Error"])
        for multi-query mode.  With mode="any", returns as soon
        as any query matches.  With mode="all", waits until every
        query has matched.
    app: Scope to this application.
    window_id: Scope to this window.
    role: Only match this role.
    states: Only match elements with ALL these states.
    fields: Which fields to search (default: ["name"]).
    mode: "any" (return when any query matches) or "all"
        (wait for all queries to match).  Only meaningful when
        element is a list.
    timeout: Maximum seconds to wait (default 10).
    source: "full" (default), "ax", "native", or "dom".
    max_results: Maximum elements to return (default 5).
    wait_for_new: If true, ignore elements already present -- wait for NEW ones.
    gone: If true, wait for matching elements to DISAPPEAR instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementYes
appNo
window_idNo
roleNo
statesNo
fieldsNo
modeNoany
timeoutNo
sourceNofull
max_resultsNo
wait_for_newNo
goneNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden and explains polling behavior ('Polls until...or timeout'), timeout defaults, and the 'wait_for_new' vs existing element logic. It could improve by explicitly stating what happens when timeout is reached (exception vs empty return).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with purpose front-loaded, followed by mechanism and usage context, then comprehensive Args documentation. Necessarily verbose due to 12 parameters with zero schema coverage, but every section earns its place with no redundant prose.

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?

Comprehensive coverage appropriate for the high complexity (12 parameters) and lack of schema documentation. Since an output schema exists, the description correctly omits return value details while thoroughly covering input parameters and behavioral modes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Given 0% schema description coverage, the Args block provides exceptional compensation by documenting all 12 parameters with semantics, defaults (e.g., timeout default 10), allowed values (e.g., source options: 'full', 'ax', 'native', 'dom'), and interactions (e.g., mode='any'/'all' only meaningful with list input).

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 immediately states the specific action ('Wait for elements') and scope ('appear or disappear'), distinguishing it from sibling tools like 'find' (immediate search) or 'click' (action). It clearly defines the tool's role in UI automation workflows.

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?

Explicitly states when to use ('Use after actions that trigger UI changes'), providing clear temporal context. However, it lacks explicit 'when not to use' guidance or named alternatives (e.g., distinguishing from 'wait_for_app' or 'wait_for_window' siblings).

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

Install Server

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/Touchpoint-Labs/Touchpoint'

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