Skip to main content
Glama
andresolbach

nodriver-mcp-server

Wait for element

wait_for_selector
Read-only

Wait for an element matching a CSS selector to appear, polling until found. Use it when the markup is known but the wording is not, returning as soon as the element shows up.

Instructions

Wait until an element matching a CSS selector appears on the page.

The structural counterpart to wait_for: use it when you know the markup but not the wording, or when the wording is localised.

Polls about three times a second and returns as soon as the element shows up. Unlike wait_for it does not return a snapshot, so follow with take_snapshot when you intend to interact.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutNoMaximum wait in milliseconds before giving up.
visibleNoAlso require the element to have a non-zero size. Use this with frameworks that insert an element into the DOM before rendering it — presence alone would otherwise resolve too early.
selectorYesCSS selector to wait for, e.g. "#login" or ".results .item".

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond the annotations (readOnlyHint, openWorldHint), the description adds meaningful behavioral context: polling frequency ('about three times a second'), early return semantics, and the absence of a snapshot in the return value. This provides value over the structured data and gives a clear picture of runtime behavior.

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, each earning its place: first states the core action, second contextualizes against wait_for, third explains behavioral nuance and follow-up. Front-loaded with the primary purpose and no wasted words.

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, combined with a comprehensive schema and annotations, fully covers what it does, when to use it, how it behaves (polling, early return), and what to do next. No important aspect is left unexplained for this simple tool.

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

Parameters3/5

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

The input schema already provides 100% coverage with detailed descriptions for all three parameters. The description adds no further parameter-specific details, so it neither helps nor hurts. Baseline 3 is appropriate given the schema handles the heavy lifting.

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 specific verb and resource: 'Wait until an element matching a CSS selector appears on the page.' It clearly distinguishes itself from the sibling wait_for by calling itself the 'structural counterpart' and explaining the difference in use cases (knowing markup vs wording).

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 when-to-use guidance: 'use it when you know the markup but not the wording, or when the wording is localised.' It also tells the user what not to expect ('does not return a snapshot') and what to do instead ('follow with take_snapshot when you intend to interact'), effectively naming the alternative wait_for in the process.

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/andresolbach/nodriver-mcp-server'

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