Skip to main content
Glama

wait_for

Wait for a text, CSS selector, or JavaScript condition to be met on the page, then return a snapshot of the current state.

Instructions

Wait for a condition on the page: text content, a CSS selector, or a JS predicate. Returns a snapshot once the condition is met. At least one condition (text, selector, or predicate) must be provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoList of texts. Resolves when any value appears in the page body.
timeoutNoTimeout in milliseconds. Default is 30000.
visibleNoWhen true and selector is set, waits for the element to be visible (not just present in DOM). Default is false.
selectorNoCSS selector. Resolves when a matching element exists in the DOM.
predicateNoA JavaScript expression that must return a truthy value. Example: "document.querySelectorAll('.item').length >= 5"
Behavior3/5

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

No annotations are provided, so the description must carry the burden of behavioral disclosure. It mentions the timeout parameter and visible flag, but does not describe what happens on timeout (e.g., error or null return) or whether the operation has side effects. It does note that a snapshot is returned once the condition is met.

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 very concise and front-loaded: the first sentence states the main purpose. The second sentence adds the return behavior and requirement. The third sentence is slightly redundant but not harmful. Overall, every sentence earns its place.

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?

With no output schema and no annotations, the description is adequate but could be more complete. It does not define what 'snapshot' means (e.g., DOM snapshot vs screenshot) or explain timeout behavior. Given the complexity of 5 parameters, it provides just enough to use the tool correctly.

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% (each parameter has a description). The tool description only summarizes the condition types without adding new meaning beyond the schema. Baseline 3 is appropriate as the description adds minimal extra value.

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 verb 'wait' and the resource 'condition on the page', listing three specific condition types (text, CSS selector, JS predicate). It distinguishes from sibling tools like evaluate_script (which evaluates JS without waiting) and take_snapshot (which captures immediately).

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 explicitly states that at least one condition must be provided, and lists the valid condition types. It gives clear context for when to use the tool, but does not provide when-not-to-use or alternatives among siblings.

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/HayoDev/safari-devtools-mcp'

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