Skip to main content
Glama

browser_axtree

Read-onlyIdempotent

Retrieves a page's accessibility tree as a compact snapshot, providing element references for clicking, filling, and other browser automation actions.

Instructions

Accessibility tree of the page via CDP. The value of a password, a one-time code or a bank card: "[masked value]".

mode="snapshot" (recommended, like Playwright MCP's ARIA snapshot): the whole page as compact indented lines, - role "name" [states] [#N]: value; every enabled control gets a reference [#N] to pass as mark=N to browser_click, browser_fill, browser_hover, browser_select_option... (valid until the next snapshot, interactive map or vision_inspect of this tab). Main frame only (cross-origin iframes: browser_interactive_map or browser_find). max_lines caps the lines (20 to 2000). mode="full": raw AX nodes (first 100).

Input Schema

NameRequiredDescriptionDefault
modeNofull
tab_idYesYour tab's id (from browser_new_tab, or a tab adopted with browser_adopt_tab).
max_linesNo

Output Schema

NameRequiredDescriptionDefault
dataYes
statusYes
warningNoEmergency stop hotkey not held, or similar notice
untrusted_noteNoPage text that looks like instructions aimed at an AI

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv2.31.6
    • addedInput schema / properties / max_lines
      Added value: +{
      +  "default": 400,
      +  "title": "Max Lines",
      +  "type": "integer"
      +}
    • addedInput schema / properties / mode
      Added value: +{
      +  "default": "full",
      +  "enum": [
      +    "full",
      +    "snapshot"
      +  ],
      +  "title": "Mode",
      +  "type": "string"
      +}
    • addedOutput schema / $defs
      Added value: +{
      +  "AxNode": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "backendDOMNodeId": {
      +        "type": "integer"
      +      },
      +      "description": {
      +        "type": "string"
      +      },
      +      "ignored": {
      +        "type": "boolean"
      +      },
      +      "name": {
      +        "type": "string"
      +      },
      +      "nodeId": {
      +        "type": "string"
      +      },
      +      "role": {
      +        "type": "string"
      +      },
      +      "value": {}
      +    },
      +    "title": "AxNode",
      +    "type": "object"
      +  },
      +  "AxTree": {
      +    "additionalProperties": true,
      +    "description": "mode=\"full\": nodeCount and nodes (first 100); mode=\"snapshot\": url, title, refs and the snapshot lines.\nValues of passwords, codes and bank cards: \"[masked value]\".",
      +    "properties": {
      +      "dialog": {
      +        "$ref": "#/$defs/PageDialog"
      +      },
      +      "dialogOpened": {
      +        "type": "boolean"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "nodeCount": {
      +        "type": "integer"
      +      },
      +      "nodes": {
      +        "items": {
      +          "$ref": "#/$defs/AxNode"
      +        },
      +        "type": "array"
      +      },
      +      "pendingDialogs": {
      +        "items": {
      +          "$ref": "#/$defs/PageDialog"
      +        },
      +        "type": "array"
      +      },
      +      "refs": {
      +        "type": "integer"
      +      },
      +      "snapshot": {
      +        "type": "string"
      +      },
      +      "title": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "type": "string"
      +      }
      +    },
      +    "title": "AxTree",
      +    "type": "object"
      +  },
      +  "PageDialog": {
      +    "additionalProperties": true,
      +    "description": "Dialog opened by the page (never accepted by the agent: browser_handle_dialog).",
      +    "properties": {
      +      "defaultPrompt": {
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "tabId": {
      +        "type": "integer"
      +      },
      +      "type": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "type": "string"
      +      }
      +    },
      +    "title": "PageDialog",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / additionalProperties
      Added value: +true
    • addedOutput schema / description
      Added value: +"Accessibility tree of the page."
    • addedOutput schema / properties / data
      Added value: +{
      +  "$ref": "#/$defs/AxTree"
      +}
    • removedOutput schema / properties / result
      Removed value: -{
      -  "title": "Result",
      -  "type": "string"
      -}
    • addedOutput schema / properties / status
      Added value: +{
      +  "const": "success",
      +  "type": "string"
      +}
    • addedOutput schema / properties / untrusted_note
      Added value: +{
      +  "description": "Page text that looks like instructions aimed at an AI",
      +  "type": "string"
      +}
    • addedOutput schema / properties / warning
      Added value: +{
      +  "description": "Emergency stop hotkey not held, or similar notice",
      +  "type": "string"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "result"
      -]New value: +[
      +  "status",
      +  "data"
      +]
    • changedOutput schema / title
      Previous value: -"browser_axtreeOutput"New value: +"AxTreeAnswer"
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld, yet the description still adds substantial behavior: sensitive values (passwords, OTPs, card numbers) are returned as "[masked value]", and reference handles [#N] expire after the next snapshot, interactive map, or vision_inspect of the tab. It also discloses the main-frame-only limitation and the 100-node cap in full mode.

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?

Purpose is front-loaded and the mode explanation is dense but well-organized. The masking sentence is an awkward fragment ("The value of a password, a one-time code or a bank card: "[masked value]".") that is cryptically worded and interrupts the flow, though it still carries real information.

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

Completeness5/5

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

With an output schema present, return values need not be explained, yet the description still sketches the snapshot line format, which helps an agent parse results. Combined with reference lifetime, frame scope, and mode semantics, nothing needed to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 33% (only tab_id is documented in the schema), so the description carries the load and does: it explains the semantic difference between mode="snapshot" (compact indented lines with references) and mode="full" (raw AX nodes, first 100), and gives max_lines a concrete range of 20 to 2000 that the schema omits.

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

Purpose5/5

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

States a specific verb+resource: retrieves the accessibility tree of the page via CDP, with an explicit output format (`- role "name" [states] [#N]: value`). It distinguishes itself from sibling page-inspection tools by scoping to the main frame and naming browser_interactive_map and browser_find as the cross-origin-iframe alternatives.

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?

Recommends mode="snapshot" as the default choice and explains when to reach for a different tool (cross-origin iframes: browser_interactive_map or browser_find). It does not, however, contrast against other page-reading siblings such as browser_content or browser_screenshot, so the when-not guidance is partial rather than complete.

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