Skip to main content
Glama
mcp-browser-dev-tools

mcp-browser-dev-tools

by Hinaser

wait_for

Pauses browser automation until specified conditions hold—element visibility, text, URL, JavaScript, or ready state—handles anyOf alternatives, and fails at timeout with last observed state.

Instructions

Wait until every given condition holds, or the first of anyOf; at timeoutMs it fails with the last observed state. Selector checks scroll the element into view. Actions already return what changed once the page settles, so wait only for something that comes later.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "wait_for"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPage URL equals this.
anyOfNoConditions with the fields above, instead of them; holds when any holds (result: matchedIndex).
stateNoWith selector (default visible); hidden means absent or not visible.
selectorNoLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdNo
timeoutMsNoms before failing (default 10000).
expressionNoPage JavaScript; holds when its (awaited) result is truthy. Throwing fails.
readyStateNodocument.readyState is at least this.
textEqualsNoThe selector's visible text equals this (whitespace collapsed).
urlIncludesNoPage URL contains this.
textExcludesNoThe selector's visible text no longer contains this; false for a missing element.
textIncludesNoThe selector's visible text contains this.
pollIntervalMsNoms between checks (default 100).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.4

TDQS

A3.6/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 load and does disclose valuable behavior: timeout fails with the last observed state, and selector checks scroll the element into view (a real side effect the schema never mentions). It does not describe what a successful wait returns, permission or session requirements, or polling cost, which leaves a meaningful gap for a blocking tool.

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?

Three compact sentences, front-loaded with the core semantics, then failure mode, then side effect, then usage guidance. Every clause carries information, though the phrase 'or the first of anyOf' is slightly compressed to the point of opacity on first read.

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?

For a 13-parameter blocking tool with no annotations and no output schema, the description covers the essentials: combination logic, timeout failure, scrolling side effect, and when to skip the call. The main omission is the success return value and session scoping, which an agent would want before blocking on a call.

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 92%, so the baseline is 3 and the schema already documents each field including defaults. The description's real contribution is the combination semantics — top-level fields must all hold, while anyOf holds when any entry matches — which the flat schema cannot express; beyond that it adds no syntax or format detail.

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 (wait) and a precise resource (page conditions: url, selector, expression, readyState, text predicates) plus the allOf/anyOf combination rule. It also implicitly distinguishes itself from the action tools by noting that actions already return what changed once the page settles, though it never names a sibling tool outright.

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?

Gives explicit when-not guidance: 'Actions already return what changed once the page settles, so wait only for something that comes later.' That steers the agent away from redundant post-action waits. No alternative tool is named in the positive case, keeping it short of a full 5.

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