Skip to main content
Glama

Snapshot interactive DOM

browser_snapshot
Read-only

Inspect a controlled page's interactive elements, including open Shadow DOM, and assign short refs for clicking or typing; optionally return visible page text.

Instructions

Inspect the controlled page's interactive elements (including open Shadow DOM), assigning short element refs (e1, e2, ...) usable by browser_click, browser_type, etc., plus optional visible page text.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_snapshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdNoControlled tab id (defaults to active controlled tab).
selectorNoOptional CSS selector to scope the snapshot root instead of document.
includeTextNoInclude trimmed visible page text (default true).
maxElementsNoMaximum interactive elements to return (default 150, max 500).
maxTextCharsNoMaximum visible text characters to return (default 4000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

The annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds useful behavioral context that the snapshot includes open Shadow DOM, assigns short element refs, and can include visible page text, though it does not state whether refs expire or remain stable across page changes.

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?

The definition is a single, front-loaded sentence with no wasted wording. It places the primary purpose and the element-ref behavior immediately, with the optional text detail clearly secondary.

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 read-only snapshot tool with a fully documented schema and annotations covering safety, the description adequately explains the main return and the element-ref mechanism. The main remaining gap is that there is no output schema and the description does not state how long refs remain valid or what the structured element data looks like.

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 100%, so all five parameters are documented in the schema. The description reinforces that visible page text is optional but does not add meaning about tabId, selector, maxElements, or maxTextChars beyond 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 description uses a specific verb ('Inspect') and resource ('interactive elements') scoped to the controlled page, and it clearly explains the unique output: short element refs usable by browser_click, browser_type, etc. This distinguishes it from text-only or screenshot siblings without opening their schemas.

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 mention that refs are usable by browser_click and browser_type implies this tool should be used before those actions, but there is no explicit when-to-use or when-not-to-use guidance. It does not say whether to prefer browser_snapshot over browser_get_text or browser_screenshot in ambiguous cases.

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