Skip to main content
Glama

wait_for

Poll until specified UI elements appear or disappear. Use after actions that trigger UI changes to synchronize automation across apps.

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?

No annotations are provided, so the description carries the full burden. It explains polling behavior, timeout, mode (any/all), the gone flag, and wait_for_new. It does not detail rate limits or auth needs, but the core behavior is transparent.

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?

The description is fairly long but appropriately structured with bulleted parameter explanations. Every sentence adds value, and the main purpose is front-loaded. It balances conciseness with the need to document 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 the complexity (12 parameters, output schema present), the description is highly complete. It covers all parameter semantics, usage context, and behavioral nuances. The presence of an output schema reduces the need to describe return values.

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?

The input schema has 0% parameter description coverage, so the description must compensate. It fully explains each parameter, including element (single or list), mode for list queries, timeout default, source options, and boolean flags like 'gone' and 'wait_for_new'.

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 clearly states the tool's purpose: 'Wait for elements to appear or disappear.' It uses a specific verb and resource, and distinguishes from sibling tools like 'wait_for_app' and 'wait_for_window' by focusing on 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?

The description provides clear guidance: 'Use after actions that trigger UI changes.' This tells the agent when to use the tool, though it does not explicitly exclude cases or mention alternatives.

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