Skip to main content
Glama

wait_for

Read-onlyIdempotent

Wait for a specified condition like element appearance, URL match, or JavaScript predicate to be true on a browser tab, avoiding fixed delays.

Instructions

Wait for a condition. Strongly prefer 'function', 'selector', or 'url_match' — they return as soon as the condition is true (1 round-trip). Use 'timeout' only as a last resort: it blocks for a fixed duration and returns no information, forcing you to poll with another tool afterwards.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYesTab ID to wait on
typeYesCondition. PREFER: 'selector' (element appears), 'selector_hidden', 'function' (custom JS predicate, e.g. value="document.querySelectorAll('.error').length>0"), 'url_match', 'navigation'. AVOID 'timeout' — it just sleeps.
valueNoSelector, JS function, URL pattern, or ms
timeoutNoMax wait in ms. Default: 30000
visibleNoRequire visibility (selector). Default: false
pollIntervalMsNoFunction mode only: predicate polling interval in ms for main-frame evaluation. Default 200, min 50, max 5000.
Behavior5/5

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

Discloses behavioral traits beyond annotations: certain types return immediately (1 round-trip), timeout blocks and returns no info. This complements annotations (readOnlyHint, idempotentHint) without contradiction.

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?

Two sentences, front-loaded with purpose, efficient delivery of key usage guidance. No superfluous content.

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?

While coverage is high, the description omits return behavior (e.g., what happens on timeout or failure). With no output schema, this gap reduces completeness. Annotations compensate partially.

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 coverage is 100%, so the schema already documents all parameters. The description does not add new per-parameter meaning beyond reinforcing preferences already in the type enum 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 description clearly states 'Wait for a condition', specifying the verb 'wait' and the resource 'condition'. It distinguishes from sibling tools like 'oc_task_wait' by focusing on page-level conditions, and the parameter context reinforces this.

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?

Explicitly guides which condition types to prefer ('function', 'selector', 'url_match') and warns against 'timeout' as a last resort, including rationale. This provides clear when-to-use and when-not-to-use guidance.

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/shaun0927/openchrome'

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