Skip to main content
Glama

Read the page's element tree

browser_snapshot
Read-only

Captures a page's accessibility tree and element refs for clicking or typing, letting you inspect and interact with the current browser session.

Instructions

The page's accessibility tree, one element per line tagged [ref=eN] for browser_click and browser_type. Refs last until the next snapshot or navigation. Capped at 40000 characters unless max_chars says otherwise.

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": {
      "session_id": "<session_id>"
    },
    "name": "browser_snapshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
timeoutNoSeconds; unset, 30.
max_charsNoCap on the tree, in characters.
session_idYesThe session_id `browser_open` returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.14.0

TDQS

A4/5.0
Behavior4/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description adds genuinely operational behavior: refs expire at the next snapshot or navigation, and output is capped at 40000 characters by default. That ref-lifetime rule is the kind of stateful detail an agent cannot get from the annotations or schema and directly affects call sequencing. It stops short of describing ordering, pagination/truncation signaling, or how a truncated tree appears.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short sentences, each doing distinct work: what is returned, how refs behave over time, and the size limit. The returned-format detail is front-loaded and there is no filler or restatement of the tool name.

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?

There is no output schema, so the description carries the burden of describing the return value — and it does, specifying an accessibility tree, one element per line, with `[ref=eN]` markers. Combined with the ref-lifetime warning and the size cap, an agent has everything needed to call this correctly and to know when its refs go stale.

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 an extra point by supplying the default cap (40000) that the `max_chars` schema entry omits, and by making the override relationship between `max_chars` and the documented cap explicit. `timeout` is left entirely to the schema, which does carry its default, so nothing critical is missing.

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 names a specific resource — the page's accessibility tree, one element per line — and states the downstream purpose of the `[ref=eN]` tags (feeding `browser_click` and `browser_type`). That distinguishes it from `browser_read`, `browser_screenshot`, and the other siblings well enough for an agent to pick it, though it never explicitly contrasts itself with them.

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?

Usage is implied rather than stated: the mention of refs for `browser_click`/`browser_type` tells an agent this is the prerequisite step before interacting, and the invalidation rule hints at when it must be re-run. But there is no explicit 'use this when... / use X instead when...' framing, and no mention of `browser_read` or `browser_screenshot` as alternatives for text-only or visual needs.

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