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

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