Skip to main content
Glama

wait

Wait for a DOM element to become visible, hidden, or attached, or pause for a set duration. Returns page state after async changes complete.

Instructions

Wait for a DOM element to reach a specified state (visible, hidden, attached, detached) or pause for a fixed duration. Use after actions that trigger asynchronous page changes such as form submissions, AJAX requests, or animations. Returns post-action page_state showing the resulting URL, title, and structural diff once the condition is met or the timeout expires, unless silent: true is set for a time-only wait, in which case only the completion signal is returned.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stateNoTarget state to wait for. 'attached' (default) = element exists in DOM; 'visible' = element is rendered and not hidden; 'hidden' = element is no longer visible; 'detached' = element removed from DOM. Use 'hidden' to wait for loading spinners to disappear.
silentNoWhen true, suppress the page_state payload from the response. Use for simple timed pauses where you don't need a structural diff — saves context tokens. Only effective for time-only waits (no selector). Default: false.
secondsNoFixed number of seconds to wait (max 300). Use when no specific element signals completion. Mutually exclusive with 'selector'.
selectorNoCSS selector of the element to wait for (e.g. ".results-loaded", "#spinner"). Mutually exclusive with 'seconds' — provide one or the other.
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. It explains return behavior (page_state or completion signal), the effect of 'silent', and the mutually exclusive parameters. However, it does not specify the default timeout or behavior if neither 'selector' nor 'seconds' is provided, which is a minor gap.

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?

The description is concise, consisting of three well-structured sentences. It front-loads the main purpose, then provides usage context, and finally details the return behavior. Every sentence adds value without redundancy.

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

Completeness4/5

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

Given the complexity (4 parameters, no output schema, no annotations), the description covers usage, parameter details, and return values well. However, it lacks explicit mention of default timeout or what happens if both 'selector' and 'seconds' are omitted, which would improve completeness.

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 coverage is 100%, providing a baseline of 3. The description adds significant value beyond the schema by explaining each state enum value, clarifying the 'silent' parameter, and explicitly stating the mutual exclusivity of 'seconds' and 'selector'. This extra context earns a score of 5.

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 waits for a DOM element to reach a specific state or pauses for a fixed duration. It uses specific verbs and resources, and distinguishes from sibling tools like 'wait_for_scripts' by focusing on DOM element states and timed pauses.

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 explicitly states when to use: 'Use after actions that trigger asynchronous page changes...'. It provides context for usage but does not explicitly mention when not to use or name alternatives, though the differentiation from siblings is implied.

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/Mingye-Lu/AgenticCrawler'

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