browser_snapshot
Capture the accessibility tree snapshot of a page and obtain element references to use with other browser tools for automated interaction.
Instructions
Capture accessibility tree snapshot of the current page. Returns element references (e1, e2, etc.) that can be used with other browser tools like click, type, etc.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| targetId | No | Target ID of the tab (from browser_tabs). If not provided, uses first available tab. | |
| maxChars | No | Maximum characters in snapshot. Truncates with notice if exceeded. Recommended: 5000-15000 for smaller models, omit for full snapshot. | |
| compact | No | Remove unnamed structural elements and empty branches. Reduces snapshot size significantly. Recommended for simpler tasks. | |
| interactive | No | Only include interactive elements (buttons, links, inputs, etc.). Dramatically reduces snapshot size. Best for form-filling and clicking tasks. | |
| maxDepth | No | Maximum tree depth to include (0 = root only). Use 3-5 for focused snapshots of complex pages. |