Skip to main content
Glama

browser_interactive_map

Read-onlyIdempotent

Extracts a compact map of visible interactive elements with marks, roles, labels, selectors, and coordinates, so agents can click or fill elements directly while using fewer tokens than raw HTML.

Instructions

Extracts a condensed map of the visible interactive elements ([#1] button, [#2] input...).

Recommended discovery tool: 85% to 95% fewer tokens than raw HTML or AXTree. Gives for each visible element: its mark number, tag, ARIA role, text label, optimized CSS selector and box_2d coordinates [ymin, xmin, ymax, xmax] (0-1000). Lets you chain clicks and fills directly with browser_click(mark=N) or browser_fill(mark=N, value=...).

Input Schema

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

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. Changed10 schema fields changedv2.31.6
    • addedOutput schema / $defs
      Added value: +{
      +  "Box": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "height": {
      +        "type": "number"
      +      },
      +      "width": {
      +        "type": "number"
      +      },
      +      "x": {
      +        "type": "number"
      +      },
      +      "y": {
      +        "type": "number"
      +      }
      +    },
      +    "title": "Box",
      +    "type": "object"
      +  },
      +  "InteractiveMap": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "count": {
      +        "type": "integer"
      +      },
      +      "dialog": {
      +        "$ref": "#/$defs/PageDialog"
      +      },
      +      "dialogOpened": {
      +        "type": "boolean"
      +      },
      +      "elements": {
      +        "items": {
      +          "$ref": "#/$defs/MapElement"
      +        },
      +        "type": "array"
      +      },
      +      "frames": {
      +        "items": {
      +          "$ref": "#/$defs/MapFrame"
      +        },
      +        "type": "array"
      +      },
      +      "message": {
      +        "type": "string"
      +      },
      +      "pendingDialogs": {
      +        "items": {
      +          "$ref": "#/$defs/PageDialog"
      +        },
      +        "type": "array"
      +      },
      +      "title": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "type": "string"
      +      },
      +      "viewport": {
      +        "$ref": "#/$defs/Box"
      +      }
      +    },
      +    "title": "InteractiveMap",
      +    "type": "object"
      +  },
      +  "MapElement": {
      +    "additionalProperties": true,
      +    "description": "Element numbered by mark (browser_click(mark=N)); box_2d [ymin, xmin, ymax, xmax] on 0-1000.",
      +    "properties": {
      +      "box_2d": {
      +        "items": {
      +          "type": "integer"
      +        },
      +        "type": "array"
      +      },
      +      "crossOriginFrame": {
      +        "type": "boolean"
      +      },
      +      "frame": {
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      },
      +      "mark": {
      +        "type": "integer"
      +      },
      +      "rect": {
      +        "$ref": "#/$defs/Box"
      +      },
      +      "role": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      },
      +      "selector": {
      +        "type": "string"
      +      },
      +      "tag": {
      +        "type": "string"
      +      },
      +      "type": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ]
      +      }
      +    },
      +    "title": "MapElement",
      +    "type": "object"
      +  },
      +  "MapFrame": {
      +    "additionalProperties": true,
      +    "properties": {
      +      "count": {
      +        "type": "integer"
      +      },
      +      "frame": {
      +        "type": "string"
      +      },
      +      "url": {
      +        "type": "string"
      +      }
      +    },
      +    "title": "MapFrame",
      +    "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: +"Visible interactive elements, numbered."
    • addedOutput schema / properties / data
      Added value: +{
      +  "$ref": "#/$defs/InteractiveMap"
      +}
    • 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_interactive_mapOutput"New value: +"MapAnswer"
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so the safety profile is covered; the description adds real value with the mark-number contract that enables click/fill chaining and the coordinate format for box_2d. The gap is that it never discloses truncation behavior — the 60-element default cap and viewport-only default are behavioral traits an agent needs to know to avoid silently missing elements.

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 statement and the token-savings claim are front-loaded, and the field enumeration is compact. The middle 'Gives for each visible element' line is somewhat listy but each item carries information an agent uses when choosing selectors, so little is wasted.

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?

An output schema exists, so the description's own exposition of return fields is a bonus rather than a necessity, and the click/fill chaining guidance closes the loop on how the output is consumed. The only material omission is how max_elements and viewport_only change what comes back, which matters for a tool whose purpose is discovery.

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 only 33%: tab_id is documented, but max_elements and viewport_only are bare. The phrase 'visible interactive elements' partially compensates for viewport_only, but the cap on returned elements — a real risk of incomplete maps — goes unmentioned, so the description does not fully fill the schema gap.

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 and resource ('Extracts a condensed map of the visible interactive elements') and enumerates the exact fields returned (mark, tag, ARIA role, label, CSS selector, box_2d). It also implicitly differentiates itself from browser_axtree by citing 85–95% token savings versus raw HTML/AXTree, so an agent can tell which discovery tool to reach for.

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?

Explicitly labels itself the 'Recommended discovery tool' and shows the downstream workflow ('chain clicks and fills directly with browser_click(mark=N) or browser_fill(mark=N, value=...)'). It stops short of stating when NOT to use it (e.g. versus browser_axtree, browser_find, or browser_vision_inspect), so alternatives are only implied via the token-cost comparison.

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