Skip to main content
Glama

wait_for

Wait for a selector, text, URL pattern, or JS condition to become true, then return. Uses in-page polling to avoid repeated DOM serialization.

Instructions

Wait until a condition holds on the page, then return. Use this instead of polling scan_page (each scan re-serializes the whole DOM). Exactly one of selector / text / url_pattern / js must be given: selector waits for a CSS match, text for a substring in body text, url_pattern for a regex on the URL, js for a JS expression to become truthy. Polls inside the page, so it costs one bridge roundtrip regardless of how long the wait takes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsNo
goneNo
textNo
timeoutNo
selectorNo
session_idNo
url_patternNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A3.9/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 behavioral burden. It does disclose useful traits: polling happens inside the page and costs only one bridge roundtrip. However, it omits important behavior such as what happens on timeout, how the 'gone' flag changes waiting, and whether the wait fails or returns early.

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 compact and front-loaded, starting with the core action, then the key alternative, then parameter semantics. Every sentence adds value and there is no repetition of schema information.

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?

The description covers the main use case and mode selection well, and an output schema exists, so return values are not required in text. However, with seven parameters and no annotations, omitting 'gone' and timeout behavior leaves the definition incomplete for more complex wait scenarios.

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?

Schema description coverage is 0%, so the description must compensate. It does well for four parameters: selector, text, url_pattern, and js. But it never explains 'gone', 'timeout' units or semantics, or 'session_id', leaving significant gaps for an agent trying to call the tool correctly.

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 clearly states the tool's purpose: 'Wait until a condition holds on the page, then return.' It names the specific condition types (selector, text, url_pattern, js) and explicitly contrasts itself with scan_page, so an agent can understand what the tool does and how it differs from at least one close sibling.

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 gives explicit guidance to use this instead of polling scan_page, with a concrete rationale about DOM re-serialization. It also explains how to choose among the four condition modes. However, it does not mention the sibling wait_for_url or clarify when to prefer that over wait_for with url_pattern.

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

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/LinVireo/browsertap-mcp'

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