Skip to main content
Glama

wait_for

Waits for a web page to be ready: checks for a CSS selector or visible text, or waits until DOM mutations settle. Supports visible/present/gone states, minimum wait time, and settlement toggling.

Instructions

Wait until the page is ready. By default waits for BOTH your condition and page settlement (DOM mutation rate decayed). Provide selector (CSS) or text (visible substring) with state visible|present|gone, or call with neither to wait for settlement alone. min_ms sets a minimum elapsed time; settle:false gates on the condition only. Returns elapsed_ms, settle diagnostics, and the matched element's ref for follow-up clicks. Times out with an error naming what WAS on the page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoA visible-text substring to wait for (matched against accessible names and nearby text). Provide at most one of selector or text.
stateNovisible (default): the selector/text is present and rendered. present: in the DOM. gone: absent or hidden. settled: wait for the page to stop churning; valid only with no selector/text.
tabIdYesTab ID to wait on. Must be a tab in the current group. Use tabs_context first if you don't have a valid tab ID.
min_msNoMinimum elapsed time before returning, even if the condition and settlement are already satisfied. Default 0.
settleNoWhether to also wait for page settlement (DOM mutation rate decay). Default true; set false to gate on the condition alone.
selectorNoA CSS selector to wait for. Provide at most one of selector or text. With state visible (default) the element must be present AND rendered; present only requires it be in the DOM; gone waits for its absence.
timeout_msNoMaximum wait in milliseconds. Default 10000, hard cap 30000.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNo
foundYes
settledNo
elapsed_msYes
final_rateNo
provenanceNo
peak_mutationsNo
Behavior4/5

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

With no annotations, the description carries the full burden and does well. It discloses the default dual wait (condition + DOM mutation decay), the meaning of each state, the effect of min_ms and settle, and error behavior ('Times out with an error naming what WAS on the page'). It also mentions the returned diagnostics and element ref. This goes well beyond a bare statement of purpose.

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 six sentences but each is dense with information. It front-loads the purpose and then procedurally explains parameters, return values, and failure mode. No fluff or repetition. The only slight drawback is length, but it remains immediately scannable due to clear grouping.

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?

For a wait tool with 7 parameters and no annotations, this description is remarkably complete. It covers all major usage modes, state semantics, default behavior, configurable conditions, timeout behavior, and return values. The presence of an output schema is acknowledged but the description already explains the key outputs (elapsed_ms, settle diagnostics, element ref). It leaves little unanswered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, giving baseline 3. The description adds value by clarifying semantic details beyond schema: it explicitly explains how min_ms and settle modify the wait, interprets state values in context, and reinforces the exclusivity constraint ('at most one of selector or text'). This additional context enhances parameter understanding.

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 opens with a clear verb+resource ('Wait until the page is ready') and elaborates on the specific scopes (condition + settlement). It distinguishes itself from sibling navigation/action tools by detailing its waiting semantics (selector/text, states, settlement) and return diagnostics.

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 concrete usage patterns: 'Provide selector (CSS) or text (visible substring) with state visible|present|gone, or call with neither to wait for settlement alone.' It explains how to combine conditions with settlement ('settle:false gates on the condition only') and mentions the timeout behavior. It lacks explicit exclusions (e.g., when NOT to use), but the implied 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/sylin-org/ghostlight'

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