Skip to main content
Glama

browser_wait_for_function

Pause browser automation until a JavaScript expression becomes truthy; set a timeout and polling interval to wait for dynamic page states before proceeding.

Instructions

Wait for a JavaScript expression to become truthy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes
session_idYes
timeout_secondsNo
poll_interval_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.1

TDQS

C2.6/5.0
Behavior2/5

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

With no annotations, the description carries the full burden. It conveys only the core blocking-wait semantics and says nothing about what happens on timeout (error vs. false return), that polling occurs, or that it is a safe read operation — all of which are relevant for an agent deciding whether to block on this call.

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

Conciseness3/5

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

A single front-loaded sentence with no waste, but it is under-specified rather than efficient — there is no second sentence of useful context, which this four-parameter wait tool clearly needs.

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

Completeness2/5

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

With four parameters, zero schema coverage, no annotations, and multiple sibling wait tools, the definition is too thin. The output schema means return-value detail is not needed, but timeout behavior, polling, and selection versus alternatives are all missing.

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% across four parameters, and the description compensates only by loosely implying the 'script' argument. Required session_id and the optional timeout_seconds and poll_interval_seconds (with their defaults) get no explanation of format, units, or effect on behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: waiting until a JavaScript expression is truthy. The 'JavaScript expression' scope implicitly separates it from the sibling wait tools (browser_wait_for_selector, browser_wait_for_url, browser_wait_for_text), though it never names them explicitly.

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?

There is no guidance on when to prefer this over browser_wait_for_selector, browser_wait_for_text, browser_wait_for_network_idle, or plain browser_wait, despite five near-neighbor wait tools in the sibling list. The agent must infer the distinction purely from the tool name.

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