Skip to main content
Glama

wait_for

Wait for an element or text to reach a specified state (present, visible, not visible, or absent) within a configurable timeout, raising an exception if the condition isn't met before proceeding.

Instructions

Wait for an element or text to reach a given state before returning. If no timeout given (0 or None), then SeleniumBase uses 7 seconds. Raises an exception if the state isn't reached within the timeout. Args: state: 'present', 'visible', 'not_visible', or 'absent' — describes what selector should reach. Ignored if text is given. selector: Element to wait on. Defaults to 'body' when waiting on text. text: If given, waits for this text to appear within selector instead of waiting on the element's presence/visibility. timeout: Seconds to wait.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
stateNovisible
timeoutNo
selectorNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure, and it delivers: default timeout behavior, exception-on-timeout, interaction between `text` and `state`, and selector defaulting. An agent can predict what will happen during execution without needing hidden context.

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 main behavior is front-loaded in one sentence, followed by a tight argument list with defaults and caveats. Every sentence earns its place, and the structure makes the behavior easy to parse quickly.

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?

The description covers the default timeout, failure behavior, all parameter interactions, and the default selector when waiting on text. Given the tool's complexity and the presence of an output schema, nothing essential is missing for an agent to invoke it correctly.

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%, so the description must compensate, and it does. It gives every parameter meaning: the `state` enum values, selector default behavior, what `text` changes, and how `timeout` is interpreted including the 0/None edge case. This is stronger than the bare schema alone.

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 names a precise operation: waiting for an element or text to reach an explicit state before returning. It enumerates the four supported states, which clearly separates it from siblings like wait_seconds, a fixed delay, or check_state, a non-blocking check.

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?

It clearly conveys when the tool applies: before returning from a step, wait for a condition. It also explains the key branch between waiting on an element state versus waiting on text, and notes that `state` is ignored when `text` is provided. It does not explicitly name alternatives or exclusions, but the operational context is unambiguous.

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

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