take_snapshot
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
| Name | Required | Description | Default |
|---|---|---|---|
| saveTo | No | 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. | |
| preview | No | Number of characters of the saved output to return inline as a preview when saveTo is used. Omit for no preview. | |
| maxDepth | No | Max tree depth | |
| maxLines | No | Max lines (default: 100) | |
| selector | No | CSS selector to scope snapshot to specific element (e.g., "#app") | |
| includeAll | No | Include all visible elements without relevance filtering. Useful for Vue/Livewire apps (default: false) | |
| includeText | No | Include text (default: true) | |
| includeAttributes | No | Include ARIA attributes (default: false) |