Skip to main content
Glama

wait_for

Read-onlyIdempotent

Wait for a condition (element, text, JS expression, navigation, or network idle). Returns found: false with a reason on timeout instead of raising; read-only.

Instructions

Block until a condition holds: element (selector in the DOM), function (JS expression turns truthy; needs the "Allow user scripts" toggle), navigation (mode=spa for client-side route changes), network_idle. Polls until timeout — 10s for element and function, 15s for navigation and network_idle — then returns found: false with a reason instead of raising, so a caller that ignores the result silently proceeds as if the wait had succeeded. Read-only: waiting changes nothing on the page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNospa = pushState/popstate/hashchangeload
textNoLiteral text to wait for (condition=text), matched case-insensitively
tab_idNoTarget tab; omitted = last tab navigated in this session, else the active one
idle_msNoQuiet period ms (network_idle)
timeoutNoMax ms (default 10000; 15000 navigation/network_idle)
visibleNoElement must also be visible
frame_idNoTarget iframe id from get_frames; omitted = main frame
intervalNoPoll ms, min 50
selectorNocondition=element; with condition=text it narrows the search to that subtree
conditionYeselement and text need selector or text; function needs expression
expressionNoJS expression (condition=function)
Behavior5/5

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

Annotations mark it read-only, idempotent, non-destructive. The description reinforces this with 'Read-only: waiting changes nothing on the page' and details the non-raising timeout behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded with the main purpose, but the later sentence about timeout behavior could be more structured. Still, every sentence adds value.

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

Completeness4/5

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

Given the complexity (11 params, condition types), the description covers the key behavioral aspects (timeout, read-only, non-raising). No output schema, but return value is hinted.

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

Parameters4/5

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

Schema coverage is 100%, so the description adds marginal value. It provides context for condition types, default timeouts, and the 'Allow user scripts' toggle, but does not detail all 11 parameters.

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 specifies the tool blocks until a condition holds, listing four distinct condition types (element, function, navigation, network_idle). It clearly distinguishes from siblings by focusing on waiting behavior.

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?

The description explains when to use each condition type and what happens on timeout (returns found: false). It lacks explicit when-not-to-use guidance but the context is clear enough.

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/frsorrentino/chrome-bridge'

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