Skip to main content
Glama

take_snapshot

Read-only

Capture a DOM snapshot with stable element UIDs to inspect page structure and target elements for browser automation. Scope it with a CSS selector or save the full tree to a file.

Instructions

Capture DOM snapshot with stable UIDs. A UID stays valid across snapshots until its element is removed or the page navigates. Output caps at maxLines (default 100); scope with selector or dump the full tree with saveTo.

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": "take_snapshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
saveToNoSave the complete snapshot text to a file (ignores maxLines) instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-mcp/output/). Relative paths resolve against the current working directory.
previewNoNumber of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview.
maxDepthNoMax tree depth
maxLinesNoMax lines (default: 100)
selectorNoCSS selector to scope snapshot to specific element (e.g., "#app")
includeAllNoInclude all visible elements without relevance filtering. Useful for Vue/Livewire apps (default: false)
includeTextNoInclude text (default: true)
includeAttributesNoInclude ARIA attributes (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • changedInput schema / properties / saveTo / description
      Previous value: -"Save the complete snapshot text to a file (ignores maxLines) instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-devtools-mcp/output/). Relative paths resolve against the current working directory."New value: +"Save the complete snapshot text to a file (ignores maxLines) instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-mcp/output/). Relative paths resolve against the current working directory."
  2. Changed2 schema fields changedv0.9.15
    • addedInput schema / properties / preview
      Added value: +{
      +  "description": "Number of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview.",
      +  "type": "number"
      +}
    • addedInput schema / properties / saveTo
      Added value: +{
      +  "description": "Save the complete snapshot text to a file (ignores maxLines) instead of returning it inline. Pass a file path, an existing directory (generated file inside), or true (generated file under ~/.firefox-devtools-mcp/output/). Relative paths resolve against the current working directory.",
      +  "type": [
      +    "boolean",
      +    "string"
      +  ]
      +}
  3. Changed2 schema fields changedv0.9.3
    • addedInput schema / properties / includeAll
      Added value: +{
      +  "description": "Include all visible elements without relevance filtering. Useful for Vue/Livewire apps (default: false)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / selector
      Added value: +{
      +  "description": "CSS selector to scope snapshot to specific element (e.g., \"#app\")",
      +  "type": "string"
      +}
  4. Changed4 schema fields changedv1.0.0
    • changedInput schema / properties / includeAttributes / description
      Previous value: -"Include detailed ARIA and computed attributes in output (default: false)"New value: +"Include ARIA attributes (default: false)"
    • changedInput schema / properties / includeText / description
      Previous value: -"Include text content in output (default: true)"New value: +"Include text (default: true)"
    • changedInput schema / properties / maxDepth / description
      Previous value: -"Maximum depth of tree to include (default: unlimited)"New value: +"Max tree depth"
    • changedInput schema / properties / maxLines / description
      Previous value: -"Maximum number of lines to return in output (default: 100)"New value: +"Max lines (default: 100)"
  5. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only supply readOnlyHint, so the description carries the real behavioral load, and it does: the UID lifecycle (valid across snapshots until element removal or navigation) is a non-obvious contract that directly changes agent strategy, and the default 100-line output cap is disclosed. It omits what the returned snapshot text actually looks like and any prerequisite (e.g. an active page). Minor tension: saveTo writes a file despite readOnlyHint, though the description frames it as an output destination rather than a state mutation.

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?

Two tight sentences, front-loaded with the capability and the UID-stability guarantee before the sizing/scoping mechanics. Every clause earns its place; nothing is repeated filler.

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?

No output schema exists, yet the description covers what an agent most needs for an 8-param read tool: UID persistence semantics, the default output cap, and the two paths for large trees. It leaves the snapshot text format and any page-state prerequisite unstated, which keeps it just short of complete.

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 coverage is 100%, so all eight parameters — including selector, saveTo, maxLines, includeAll — are already documented in the schema with defaults and formats. The description restates maxLines default 100 and saveTo's maxLines-overriding behavior, adding essentially no meaning beyond structured fields. Baseline 3 applies when the schema does the heavy lifting.

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?

"Capture DOM snapshot with stable UIDs" gives a specific verb (capture) and resource (DOM tree), plus the differentiator that matters most — UIDs are stable and reusable. It never names a sibling (e.g. get_page_text, screenshot_page, resolve_uid_to_selector), so an agent must infer from the broader catalogue which sibling is the text/screenshot alternative. Clear purpose, no explicit sibling differentiation.

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 description implies a workflow — take a snapshot, act on UIDs, and re-snapshot after navigation because UIDs die on page change — and it explains two output modes (scope with selector vs. dump the full tree with saveTo). It never states when NOT to use this tool, nor contrasts it with get_page_text or screenshot_page for text/visual needs. Usage is inferable but not spelled out.

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