Skip to main content
Glama

wait_for

Wait for UI elements to appear or disappear on any desktop app, with flexible timeout and multi-query support. Polls until conditions are met or time runs out.

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), "cdp_ax", "native", or "dom".
        "ax" remains as a compatibility alias for "cdp_ax".
    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
Behavior5/5

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

No annotations provided, so description carries full burden. Discloses polling behavior, timeout, multi-query mode (any/all), gone parameter, wait_for_new, and source options. Transparent about key behaviors.

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?

Front-loaded with a one-sentence summary, then structured bullet points for parameters. Every sentence adds value; no redundancy. Efficient for the complexity of 12 parameters.

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?

Given 12 parameters, no annotations, and an output schema, the description covers all necessary aspects: usage context, parameter behavior, and polling logic. Output schema handles return value, so no gap.

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?

Schema has 0% description coverage, so description compensates fully. Provides detailed explanations for all 12 parameters, including default values, behavior for element as list, mode, and source aliases.

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?

Clearly states it waits for elements to appear or disappear, specifying verb ('wait'), resource ('elements'), and the two modes. Distinguishes from sibling tools like wait_for_app and wait_for_window by focusing on UI elements.

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 recommends use 'after actions that trigger UI changes', providing clear context. However, does not mention exclusions or directly contrast with sibling tools like wait_for_app or wait_for_window.

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