Skip to main content
Glama

wait_for

Wait for an element or text to reach a specified state (present, visible, not_visible, absent) on dynamic pages. Synchronize automation by pausing until the condition is met, with a configurable timeout.

Instructions

Wait until an element or text reaches a requested state.

Use this tool when the page is dynamic and an automation step must wait for a condition before continuing.

Unlike check_for_condition, this tool intentionally waits. Unlike assert_condition, its purpose is synchronization rather than validating a test expectation.

Args: state: - "present": Wait until the matching element exists. - "visible": Wait until the matching element is visible. - "not_visible": Wait until the matching element is not visible. - "absent": Wait until the matching element no longer exists. Ignored when text is provided. selector: CSS selector or SeleniumBase selector for the element. Required unless text is supplied. text: If supplied, wait for this text to appear within selector (or within "body" when selector is omitted). timeout: Maximum seconds to wait. Defaults to 7 seconds.

Returns: A confirmation when the requested condition is reached.

Tool selection: - Check current state immediately -> use check_for_condition. - Wait for a state/content transition -> use wait_for. - Verify an expected value/condition -> use assert_condition.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
stateNovisible
timeoutNo
selectorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.7/5.0
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 discloses the waiting behavior, the meaning of each state, and the text/selector interaction, including 'Ignored when text is provided.' However, it does not state what happens on timeout (e.g., exception vs. false return), which is a behavioral gap for a tool whose core action is blocking.

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 well-structured with clear sections (Args, Returns, Tool selection), front-loads the core purpose, and every sentence adds value. The sibling comparisons and selection list are concise and highly actionable without unnecessary fluff.

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 tool has no annotations and only a minimal input schema, the description covers the essential usage, parameters, and selection logic comprehensively. The only notable omission is timeout failure behavior, which an agent might need to handle robustly. Overall it is nearly complete for correct invocation.

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 description coverage is 0%, but the description fully documents every parameter: the state enum with per-value meanings, selector requirement, text fallback to body, and timeout default. This goes well beyond the raw schema and compensates completely for the missing schema descriptions.

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 opening sentence states a specific verb and resource: 'Wait until an element or text reaches a requested state.' This clearly distinguishes wait_for from siblings like check_for_condition and assert_condition by naming them directly and contrasting the behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit usage guidance: 'Use this tool when the page is dynamic and an automation step must wait for a condition before continuing.' Then gives a bulleted tool-selection list mapping each sibling to its use case, leaving no ambiguity about when to choose wait_for.

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/seleniumbase/SeleniumBase'

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