Skip to main content
Glama

wait

Wait for a DOM element to become visible, hidden, attached, or detached, or pause for a fixed duration. Use after triggers like form submissions or AJAX requests to capture the resulting page state.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.
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.
Behavior4/5

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

No annotations provided, but the description covers key behaviors: returns post-action page_state with URL, title, structural diff, and mentions timeout expiration. This is sufficient given the tool's simplicity.

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?

Three sentences, front-loaded with purpose, no unnecessary words. Every sentence adds value.

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?

No output schema, but description explains return value (page_state). Covers all necessary information for a simple wait tool.

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%, and the description adds valuable context: seconds max 300, selector examples, state defaults and use cases (e.g., 'hidden' for loading spinners). This goes beyond the schema.

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 state or fixed duration, listing specific states (visible, hidden, attached, detached) and examples like pausing for async changes. It distinguishes itself from sibling tools like wait_for_scripts.

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: 'after actions that trigger asynchronous page changes' and explains mutual exclusivity of seconds and selector. It does not explicitly state when not to use, but context is clear.

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