Skip to main content
Glama

browser_wait_for_element

Waits until a page element matching a CSS selector appears, optionally requiring it to be visible and rendered, so automation can proceed only when the target is ready.

Instructions

Wait for an element matching selector. visible=true also requires it to be rendered. tab: the handle browser_new_tab returned ("t3"). Pass it on every call: several agents can share this server, and the tab is how each one keeps to its own page.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>"
    },
    "name": "browser_wait_for_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabNo
timeoutNo
visibleNo
selectorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/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 behavioral burden, and it does disclose a non-obvious trait: the server is shared across agents and the tab handle is how each keeps to its own page. However, it never says what happens when the wait times out (does it raise, return false, hang?) or whether it polls the DOM, which are the behaviors an agent most needs to plan around.

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 tight sentences, front-loaded with the core action and then the two modifiers. The tab sentence is slightly long relative to its payload but the rationale it carries justifies the length.

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?

There is no output schema and no annotations, so the description should cover both input meaning and result shape. It omits what a successful wait returns (an element handle or ref usable by `browser_click_ref`/`browser_fill_ref`?) and what a failed wait looks like, both of which matter for chaining in this tool ecosystem.

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 description coverage is 0%, so the description must compensate, and it does for three of four parameters: `selector`, `visible`, and `tab` (with a concrete handle example like "t3"). `timeout` is never mentioned — no units, no indication of default duration behavior — so a quarter of the parameters remains undocumented.

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 opens with a specific verb and resource: wait for an element matching a CSS `selector`, and clarifies that `visible=true` additionally requires rendering. That is concrete and agent-selectable, though it does not explicitly differentiate itself from siblings like `browser_wait_for_load` or `browser_wait`, leaving the agent to infer the distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear usage rules for the `visible` flag and mandates passing `tab` on every call, which is real guidance. It never states when to prefer this over `browser_wait_for_load` or plain `browser_wait`, so the when-versus-alternative question is left implied.

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