Skip to main content
Glama

wait_for

Polls the page DOM until a CSS selector or visible text appears, or until a timeout is reached. Use it to sync automation steps with dynamic page content.

Instructions

Poll the DOM until a CSS selector or visible text appears (or timeout)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNo
textNo
selectorNo
timeout_msNo
interval_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the polling mechanism, the wait condition, and the timeout fallback. However, it does not state what happens on timeout (error/return value), whether ref targets a specific frame/window, or whether visibility is required for both selectors and text.

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?

A single sentence that is front-loaded with the core action, covers the main condition, and mentions the timeout. No filler or repetition; every phrase contributes.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with five parameters, no output schema, and no annotations, the description is minimally adequate: it conveys the polling behavior and target condition. But it omits key calling details like whether at least one of selector/text must be provided, how ref scopes the operation, and the success/failure contract on timeout.

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

Parameters2/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. It adds meaning to 'selector' and 'text' by explaining that either a CSS selector or visible text can be the wait target. It does not clarify 'ref', the relationship between selector and text (mutually exclusive? combinable?), or the semantics of timeout_ms/interval_ms beyond their names.

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 uses a specific verb ('Poll') and names the resource ('the DOM') and the termination condition ('until a CSS selector or visible text appears'). It clearly distinguishes itself from siblings like wait_for_load and wait_for_captcha by focusing on selector/text appearance rather than page load or captcha state.

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

Usage Guidelines2/5

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

The description states what the tool does but provides no explicit guidance on when to use it versus alternatives such as wait_for_load or wait_for_captcha. There are no 'use this when...' or 'instead of...' cues for an agent to route correctly.

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