Skip to main content
Glama

wait_for

Pause automation until a page condition holds: visible element, page text, URL substring, network idle, or JS expression true. Use assert mode to check once and fail immediately.

Instructions

Wait for a condition: element visible, page text present, URL match, network idle, or JS expression true. Prefer condition:'text' over a JS expression for "has the page said X yet". Set assert:true to check once and fail instead of waiting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoSubstring of the page URL — required when condition is 'url'
textNoSubstring of the page's visible text — required when condition is 'text'. Case-sensitive; matches document.body.innerText, i.e. what a reader sees.
assertNoAssert instead of wait: check the condition once and fail if it does not hold (default timeout becomes 0). Failures carry _meta.code = 'assertion_failed'.
timeoutNoMaximum wait time in milliseconds (default: 10000, or 0 when assert is true)
selectorNoCSS selector or element ref (e.g. 'e5') — required when condition is 'element'
conditionYesWhat to wait for: element visibility, visible page text, the URL, network idle, or a JS expression returning true
expressionNoJavaScript expression that should evaluate to true — required when condition is 'js'
Install Server

TDQS

A4.6/5.0
Behavior5/5

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

Since no annotations are provided, the description carries the full burden of behavioral disclosure. It clearly explains the wait behavior, the effect of assert:true (single check, fail, default timeout becomes 0), the failure code _meta.code = 'assertion_failed', and even notes that text matching is case-sensitive and uses document.body.innerText. This is thorough and leaves little ambiguity for an agent.

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 two sentences long, front-loads the core purpose, and packs in the most important usage notes (condition preference and assert behavior) without filler. Every clause earns its place; it is appropriately sized for a tool with this complexity.

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 no output schema, the description covers the key operational details: conditions, timeouts, assert failure behavior, and text matching semantics. It doesn't explicitly state what the tool returns on success, but for a wait tool that is typically a boolean or void, and the absence is minor. The description is sufficient for an agent to call it correctly without further clarification.

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?

With 100% schema description coverage, the baseline is 3. The description enriches the schema by adding practical guidance: it explains that text is case-sensitive and matches visible innerText, and it recommends condition:'text' over JS expressions for page-text checks. This goes beyond the schema's bare descriptions and adds decision-making value.

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 states a specific verb ('Wait for') and resource ('a condition') and enumerates the distinct condition types (element visibility, page text, URL, network idle, JS expression). It is unambiguous and provides enough specificity that an agent can understand the tool's role without needing to inspect siblings.

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 offers concrete usage guidance: it recommends preferring condition:'text' over a JS expression for checking page text, and explicitly explains when to use assert:true ('check once and fail instead of waiting'). While it doesn't spell out when to avoid this tool in favor of an alternative, the preference and assert instructions give clear context for choosing among the tool's own modes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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/Silbercue/public-browser'

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