Skip to main content
Glama

browser_wait

Wait for page conditions such as element visibility, text, URL, or network idle within a timeout, returning per-check pass/fail results.

Instructions

Read-only verification under one deadline; a top-level condition is shorthand for one check. Both forms return status=pass/fail/unavailable, per-check expected/actual and zero-based failed/unavailable indices; unmet checks are normal results. fail means unmet by the deadline, not business failure. retry_safe applies only to repeating this read, never prior actions. No atomic cross-frame view or persistence guarantee. Text uses full innerText with bounded previews; field values and exact value expectations are omitted. Role absence need not mean DOM removal.

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": {
      "tab_handle": "<tab_handle>"
    },
    "name": "browser_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
notNoNegate an available comparison; unavailable stays unavailable. Missing scalar targets do not pass negation.
nthNoZero-based match index.
nameNoExact AX name; role only.
frameNoChild frame; see shared locator rules.
checksNoUse checks or one top-level condition with its fields, never both; all must pass in the same round. count allows multiple matches.
idle_msNonetwork_idle quiet interval; default 500.
expectedNotext/url: substring; value: exact string; checked/selected/expanded/value_present: boolean (checked also "mixed"); count: exact integer, no nth. Whitespace is nonempty for value_present. Omit for other conditions.
frame_idNo
previousNotext only: complete prior innerText, exclusive with expected. Text change does not establish new-run completion.
selectorNoLocator query.
conditionNoElement conditions require selector; url/network_idle forbid locator fields.
tab_handleYes
timeout_msNo
dialog_policyNo
selector_typeNoDefault css.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed18 schema fields changedv0.34.0
    • addedInput schema / properties / checks
      Added value: +{
      +  "description": "Use checks or one top-level condition with its fields, never both; all must pass in the same round. count allows multiple matches.",
      +  "items": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "condition": {
      +        "description": "Element conditions require selector; url/network_idle forbid locator fields.",
      +        "enum": [
      +          "attached",
      +          "absent",
      +          "visible",
      +          "actionable",
      +          "text",
      +          "value",
      +          "checked",
      +          "selected",
      +          "expanded",
      +          "url",
      +          "network_idle",
      +          "count",
      +          "value_present"
      +        ],
      +        "type": "string"
      +      },
      +      "expected": {
      +        "anyOf": [
      +          {
      +            "maxLength": 100000,
      +            "type": "string"
      +          },
      +          {
      +            "type": "boolean"
      +          },
      +          {
      +            "maximum": 9007199254740991,
      +            "minimum": 0,
      +            "type": "integer"
      +          }
      +        ],
      +        "description": "text/url: substring; value: exact string; checked/selected/expanded/value_present: boolean (checked also \"mixed\"); count: exact integer, no nth. Whitespace is nonempty for value_present. Omit for other conditions."
      +      },
      +      "frame": {
      +        "additionalProperties": false,
      +        "description": "Child frame; see shared locator rules.",
      +        "properties": {
      +          "path": {
      +            "items": {
      +              "minLength": 1,
      +              "type": "string"
      +            },
      +            "maxItems": 16,
      +            "minItems": 1,
      +            "type": "array"
      +          },
      +          "title": {
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "url": {
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "frame_id": {
      +        "type": "string"
      +      },
      +      "idle_ms": {
      +        "description": "network_idle quiet interval; default 500.",
      +        "maximum": 10000,
      +        "minimum": 100,
      +        "type": "integer"
      +      },
      +      "name": {
      +        "description": "Exact AX name; role only.",
      +        "maxLength": 10000,
      +        "type": "string"
      +      },
      +      "not": {
      +        "description": "Negate an available comparison; unavailable stays unavailable. Missing scalar targets do not pass negation.",
      +        "type": "boolean"
      +      },
      +      "nth": {
      +        "description": "Zero-based match index.",
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "previous": {
      +        "description": "text only: complete prior innerText, exclusive with expected. Text change does not establish new-run completion.",
      +        "maxLength": 100000,
      +        "type": "string"
      +      },
      +      "selector": {
      +        "description": "Locator query.",
      +        "maxLength": 10000,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "selector_type": {
      +        "description": "Default css.",
      +        "enum": [
      +          "css",
      +          "xpath",
      +          "label",
      +          "placeholder",
      +          "role"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "condition"
      +    ],
      +    "type": "object"
      +  },
      +  "maxItems": 30,
      +  "minItems": 1,
      +  "type": "array"
      +}
    • changedInput schema / properties / condition / enum
      Previous value: -[
      -  "attached",
      -  "absent",
      -  "visible",
      -  "actionable",
      -  "text",
      -  "value",
      -  "checked",
      -  "selected",
      -  "expanded",
      -  "url",
      -  "network_idle"
      -]New value: +[
      +  "attached",
      +  "absent",
      +  "visible",
      +  "actionable",
      +  "text",
      +  "value",
      +  "checked",
      +  "selected",
      +  "expanded",
      +  "url",
      +  "network_idle",
      +  "count",
      +  "value_present"
      +]
    • addedInput schema / properties / dialog_policy / const
      Added value: +"ask"
    • removedInput schema / properties / dialog_policy / default
      Removed value: -"ask"
    • removedInput schema / properties / dialog_policy / description
      Removed value: -"accept/dismiss auto-handle dialogs and return their messages."
    • removedInput schema / properties / dialog_policy / enum
      Removed value: -[
      -  "ask",
      -  "accept",
      -  "dismiss"
      -]
    • changedInput schema / properties / expected / anyOf
      Previous value: -[
      -  {
      -    "maxLength": 100000,
      -    "type": "string"
      -  },
      -  {
      -    "type": "boolean"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 100000,
      +    "type": "string"
      +  },
      +  {
      +    "type": "boolean"
      +  },
      +  {
      +    "maximum": 9007199254740991,
      +    "minimum": 0,
      +    "type": "integer"
      +  }
      +]
    • changedInput schema / properties / expected / description
      Previous value: -"Required for url (substring), value (exact), checked/selected/expanded (boolean; checked also \"mixed\"). text: expected substring XOR previous. Omit otherwise."New value: +"text/url: substring; value: exact string; checked/selected/expanded/value_present: boolean (checked also \"mixed\"); count: exact integer, no nth. Whitespace is nonempty for value_present. Omit for other conditions."
    • changedInput schema / properties / frame / description
      Previous value: -"Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id."New value: +"Child frame; see shared locator rules."
    • removedInput schema / properties / idle_ms / default
      Removed value: -500
    • changedInput schema / properties / idle_ms / description
      Previous value: -"network_idle quiet interval."New value: +"network_idle quiet interval; default 500."
    • changedInput schema / properties / name / description
      Previous value: -"role only: exact AX name; empty allowed."New value: +"Exact AX name; role only."
    • addedInput schema / properties / not
      Added value: +{
      +  "description": "Negate an available comparison; unavailable stays unavailable. Missing scalar targets do not pass negation.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / nth / description
      Previous value: -"Selector only: zero-based DOM index, AX tree order for role."New value: +"Zero-based match index."
    • changedInput schema / properties / previous / description
      Previous value: -"text only: complete prior innerText, not a truncated preview; exclusive with expected. Change does not establish new-run completion."New value: +"text only: complete prior innerText, exclusive with expected. Text change does not establish new-run completion."
    • changedInput schema / properties / selector / description
      Previous value: -"Query by selector_type; role example: selector=\"link\", name=\"Claim\"."New value: +"Locator query."
    • changedInput schema / properties / selector_type / description
      Previous value: -"Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute."New value: +"Default css."
    • changedInput schema / required
      Previous value: -[
      -  "tab_handle",
      -  "condition"
      -]New value: +[
      +  "tab_handle"
      +]
  2. Changed1 schema field changedv0.25.2
    • changedInput schema / properties / previous / description
      Previous value: -"text only: wait for full rendered innerText to change; exclusive with expected."New value: +"text only: complete prior innerText, not a truncated preview; exclusive with expected. Change does not establish new-run completion."
  3. Changed10 schema fields changedv0.24.2
    • addedInput schema / properties / condition / description
      Added value: +"Element conditions require selector; url/network_idle forbid locator fields."
    • changedInput schema / properties / dialog_policy / description
      Previous value: -"accept/dismiss returns handled dialog messages."New value: +"accept/dismiss auto-handle dialogs and return their messages."
    • changedInput schema / properties / expected / description
      Previous value: -"text/url: substring; value: exact string; checked/selected/expanded: boolean (checked also accepts \"mixed\")."New value: +"Required for url (substring), value (exact), checked/selected/expanded (boolean; checked also \"mixed\"). text: expected substring XOR previous. Omit otherwise."
    • changedInput schema / properties / frame / description
      Previous value: -"Exact child-frame URL/title or CSS iframe path (e.g. [\"#content_iframe\"]); alternative to frame_id. Each path entry uniquely selects an iframe in the preceding document."New value: +"Child frame: at least one of url/title/path. url/title exact; path=unique nested CSS iframe steps (e.g. [\"#frame\"]); exclusive with frame_id."
    • addedInput schema / properties / idle_ms / description
      Added value: +"network_idle quiet interval."
    • changedInput schema / properties / name / description
      Previous value: -"role only: exact accessible name; may be empty."New value: +"role only: exact AX name; empty allowed."
    • changedInput schema / properties / nth / description
      Previous value: -"Zero-based match index: DOM order, or AX tree order for role."New value: +"Selector only: zero-based DOM index, AX tree order for role."
    • changedInput schema / properties / previous / description
      Previous value: -"Text only: wait for full rendered innerText to differ; alternative to expected."New value: +"text only: wait for full rendered innerText to change; exclusive with expected."
    • changedInput schema / properties / selector / description
      Previous value: -"CSS/XPath query, HTML label text, exact placeholder or AX role (e.g. selector=\"link\", name=\"Claim\"), according to selector_type."New value: +"Query by selector_type; role example: selector=\"link\", name=\"Claim\"."
    • changedInput schema / properties / selector_type / description
      Previous value: -"Default css. label matches associated HTML labels with whitespace normalized; role uses browser AX semantics."New value: +"Default css. label: exact associated HTML label, whitespace normalized. placeholder: exact attribute."
  4. Changed1 schema field changedv0.24.1
    • changedInput schema / properties / selector / description
      Previous value: -"CSS/XPath query, HTML label text, exact placeholder or AX role, according to selector_type."New value: +"CSS/XPath query, HTML label text, exact placeholder or AX role (e.g. selector=\"link\", name=\"Claim\"), according to selector_type."
  5. First observedv0.24.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations supplied, the description carries the whole burden and does substantial work: it discloses the return contract (status=pass/fail/unavailable, per-check expected/actual, zero-based failed/unavailable indices), reframes 'fail' as 'unmet by the deadline, not business failure', scopes retry_safe to repeating this read only, and disclaims atomic cross-frame views and persistence. It also flags that text responses use bounded innerText previews with field values omitted and that role absence need not mean DOM removal. The notable gap is dialog_policy ('ask'), whose runtime behavior during a wait is never explained.

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?

The content is dense but vital and the deadline/read-only constraint is front-loaded; there is little filler. The problem is delivery: everything is packed into semicolon-joined fragments with no grouping of return contract, semantics, and caveats, making it hard to parse. The size is defensible for a 15-parameter tool, but the structure is poor.

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 complex, 15-parameter tool with nested check objects and no output schema, the description supplies the return shape and the pass/fail interpretation that would otherwise be missing, plus limit caveats on frames, text preview and role absence. It still leaves dialog_policy and the timeout/deadline parameter's defaults unexplained, and defers locator rules to an unstated shared spec. Overall it covers the call-critical behavior without being exhaustive.

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 73%, so structured descriptions already carry most parameter meaning, and the description adds only targeted clarifications: that the two condition forms are mutually exclusive shorthands, that all checks must pass 'in the same round', and that text matching uses full innerText with bounded previews while exact value expectations are omitted. Key parameters such as tab_handle, timeout_ms (default 5000, max 30000) and dialog_policy receive no treatment. This is the expected baseline-plus-a-little for a high-coverage schema.

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 opening clause, 'Read-only verification under one deadline', together with 'a top-level condition is shorthand for one check', tells the agent this tool blocks until page conditions are satisfied or the deadline expires, and hints at its two input forms. The verb 'wait' never appears and no sibling such as browser_snapshot or browser_read_text is named as the non-blocking alternative, so the agent must infer the tool's place in the family. Purpose is clear but not differentiated from siblings.

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 explains an internal usage rule ('Use checks or one top-level condition with its fields, never both') and clarifies that 'unmet checks are normal results' rather than errors, which shapes how the agent should react. However, there is no explicit statement of when to reach for browser_wait versus a one-shot read like browser_read_text or browser_snapshot. Usage is implied by the deadline/polling semantics rather than stated.

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