Skip to main content
Glama

take_snapshot

Read-only

Capture a DOM snapshot with stable UIDs, letting you inspect page structure and reliably reference elements across snapshots.

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.

Input Schema

TableJSON 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-devtools-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)
Behavior5/5

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

Beyond the readOnlyHint annotation, the description discloses important behavioral details: UIDs remain valid until element removal or navigation, output is capped at maxLines, selector scoping is available, and saveTo dumps the full tree. This provides a meaningful behavioral contract without contradicting the annotation.

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 compact sentences, front-loaded with the core action, and every clause carries unique information. There is no filler or repetition of schema content beyond what is useful for orientation.

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 tool with no output schema and 8 optional parameters, the description covers purpose, UID semantics, output-limiting behavior, scoping, and full-tree handling. It could be slightly more explicit about the exact return shape (e.g., whether output is a text tree containing UIDs), but the core contract is sufficiently clear.

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?

The schema already documents all 8 parameters with detailed descriptions. The tool description adds extra value by connecting maxLines default, selector scoping, and saveTo as a way to get the full tree, which helps the agent choose between inline and file output.

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?

Description uses a specific verb ('Capture') with a clear resource ('DOM snapshot') and defines the key outcome ('stable UIDs'). This distinguishes it from visual captures like screenshot_page and UID-using sibling actions like click_by_uid or fill_by_uid.

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?

The description clearly implies this tool produces UIDs used by sibling UID-based tools and explains UID stability across snapshots. It does not, however, explicitly state when to prefer this over alternatives like screenshot_page or resolve_uid_to_selector, nor does it mention exclusions.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mozilla/firefox-devtools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server