Skip to main content
Glama

Snapshot page elements

browser_snapshot
Read-onlyIdempotent

Lists a browser tab’s interactive elements—links, buttons, inputs, tabs, checkboxes, rows, and iframe controls—with click indices, title, and URL so agents can target them accurately.

Instructions

List the interactive elements (links, buttons, inputs, tabs, checkboxes, table and grid rows listed as row with their cell text, and other clickable elements) on the page in one of the agent's tabs, with the index each one has for browser_click, plus the page title and URL. Inputs show their type, such as input[password], and text the page lets you edit in place shows as [editable], such as span[editable] (click it, or browser_fill it); checkboxes, radios and switches are named by their label and show their state, such as (checked) or (unchecked, disabled). Controls inside frames (iframes), such as an embedded support chat, payment form or sign-in box, are listed after the page's own, each marked with the frame it is in; their indices work with browser_click, browser_fill and browser_upload_file like any other. Works on a background tab, so the user can be looking at something else. Use it before every browser_click, because indices change when the page changes; use browser_read for the page's text. Read-only. Automatically scopes to the topmost visible dialog when one is open, naming it on a dialog: line, excluding hidden/inert controls but retaining reachable offscreen controls. Results report scope, total and truncation. Continue with offset and limit on the same tab/session; indices stay global across pages of an unchanged UI. Snapshot again after UI changes. While the page has a JavaScript dialog open (alert, confirm, prompt), the snapshot shows the dialog's type, message and dialog_id instead, for browser_handle_dialog.

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_id": "<tab_id>"
    },
    "name": "browser_snapshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum controls returned per page (default 250, maximum 250).
offsetNoControl offset for pagination (default 0). Use the continuation offset from the previous result on an unchanged UI.
tab_idYestab_id of one of the agent's tabs, from browser_open_tab or browser_list_tabs
session_idNoStable task or thread ID. Pass the same value on every browser call for this task. Different IDs isolate tabs and cleanup within one MCP process. Omit for the default process session.
wait_timeout_msNoBound for wait_for_selector in milliseconds (default 8000, maximum 10000; 0 checks once). Requires wait_for_selector. Timeout preserves action success and returns current state. Use browser_snapshot with the same wait to re-observe without repeating an action.
wait_for_selectorNoWait for any visible element matching this CSS selector in the page or any of its frames (iframes), including open shadow roots (web components); a timeout says how many frames could not be searched. On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.14.0
    • changedInput schema / properties / wait_for_selector / description
      Previous value: -"Wait for any visible element matching this CSS selector in the page, including open shadow roots (web components); child frames are not searched, and a timeout says how many were visible. On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI."New value: +"Wait for any visible element matching this CSS selector in the page or any of its frames (iframes), including open shadow roots (web components); a timeout says how many frames could not be searched. On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI."
  2. Changed1 schema field changedv0.11.2
    • changedInput schema / properties / wait_for_selector / description
      Previous value: -"Wait for any visible element matching this CSS selector in the top-level document (not frames or shadow roots). On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI."New value: +"Wait for any visible element matching this CSS selector in the page, including open shadow roots (web components); child frames are not searched, and a timeout says how many were visible. On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI."
  3. Changed4 schema fields changedv0.7.1
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Maximum controls returned per page (default 250, maximum 250).",
      +  "maximum": 250,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "description": "Control offset for pagination (default 0). Use the continuation offset from the previous result on an unchanged UI.",
      +  "maximum": 2147483647,
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / wait_for_selector
      Added value: +{
      +  "description": "Wait for any visible element matching this CSS selector in the top-level document (not frames or shadow roots). On actions requires return_state=true. Returns readiness met, timeout or error; only this condition is checked, not general app readiness. Prefer a selector specific to the expected new UI.",
      +  "maxLength": 2000,
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / wait_timeout_ms
      Added value: +{
      +  "description": "Bound for wait_for_selector in milliseconds (default 8000, maximum 10000; 0 checks once). Requires wait_for_selector. Timeout preserves action success and returns current state. Use browser_snapshot with the same wait to re-observe without repeating an action.",
      +  "maximum": 10000,
      +  "minimum": 0,
      +  "type": "integer"
      +}
  4. Changed1 schema field changedv0.4.3
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Stable task or thread ID. Pass the same value on every browser call for this task. Different IDs isolate tabs and cleanup within one MCP process. Omit for the default process session.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  5. Changed1 schema field changedv0.3.1
    • changedInput schema / properties / tab_id / description
      Previous value: -"From browser_open_tab or browser_list_tabs"New value: +"tab_id of one of the agent's tabs, from browser_open_tab or browser_list_tabs"
  6. First observedv0.3.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent/open-world, but the description adds substantial behavior: it works on a background tab, auto-scopes to the topmost visible dialog, excludes hidden/inert controls while retaining reachable offscreen ones, reports scope/total/truncation, lists iframe contents after the page's own, and switches to a dialog_id view when a JS dialog is open. These are non-obvious traits an agent cannot infer from the annotations.

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 mostly load-bearing and front-loaded with the core purpose, but it is delivered as one dense paragraph with nested parentheticals, making it hard to scan for a tool with this much behavioral nuance. Breaking the frame, dialog, and pagination rules into distinct sentences or lines would preserve the information with less friction.

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?

Given no output schema, the description fully covers what is returned (indexed elements, title, URL, scope/total/truncation, dialog details), how frames and dialogs are handled, and the staleness rule that drives re-snapshotting. Nothing an agent needs to call it correctly against the six-parameter schema is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns above that by explaining that offset/limit continue pagination and that 'indices stay global across pages of an unchanged UI,' which clarifies how the pagination parameters relate to the returned indices. It does not restate tab_id or wait_for_selector semantics, but those are already well documented in the schema.

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?

The opening sentence names a specific verb and resource — list the interactive elements on a tab's page — and enumerates exactly what counts (links, buttons, inputs, tabs, checkboxes, row/grid rows with cell text). It also states the key output (index usable by browser_click plus title and URL), which clearly separates it from browser_read and browser_screenshot.

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

Usage Guidelines5/5

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

It gives an explicit imperative: 'Use it before every browser_click, because indices change when the page changes,' and names a concrete alternative ('use browser_read for the page's text'). It further specifies when to continue paginating (offset/limit on an unchanged UI) and when to re-snapshot (after UI changes).

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