Skip to main content
Glama

browser_wait_for_result

Evaluate a JavaScript expression repeatedly until it returns a non-empty result, enabling agents to wait for dynamic page elements or data before proceeding.

Instructions

Poll a JavaScript expression until it returns a non-empty result.

Args: code: JavaScript expression to evaluate repeatedly timeout: Maximum time to wait in milliseconds poll_interval: How often to check in milliseconds tab_id: Optional tab to target. Defaults to active tab.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
tab_idNo
timeoutNo
poll_intervalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/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 burden. It does disclose the core behavioral trait (repeated polling until a non-empty result), which is genuinely useful, but it omits failure modes: what happens on timeout, whether an error is raised or an empty value returned, and the evaluation context of the code.

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 core behavior is front-loaded in one sentence, followed by a compact Args list. No filler sentences; each line earns its place, though the Args block partially restates schema property names.

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?

For a polling tool with no annotations and no output schema, the description covers inputs and mechanism but leaves the return contract and timeout behavior unspecified. An agent can call it, but cannot predict what a timeout yields, which is a meaningful gap for a wait tool.

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 description coverage is 0%, so the description must compensate, and it largely does: it documents all four parameters with units (milliseconds), the meaning of code, and the tab_id default behavior. It adds real meaning beyond the bare schema titles, though it does not restate the numeric defaults for timeout/poll_interval.

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?

The description names a specific verb (poll) and resource (a JavaScript expression until it returns a non-empty result), which clearly conveys the tool's operation. It distinguishes itself functionally from siblings like browser_js (single evaluation) and browser_wait_for_element, though it does not name those siblings 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 explicit when-to-use guidance, no exclusions, and no routing among the many browser_wait_for_* siblings (url, element, network_idle, title). The polling behavior implies a use case, but the agent is left to infer it, so this is below the minimum-viable bar.

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

Deploy Server

Other Tools