debug_get_dom_tree
Retrieves a structured DOM tree from a browser context for analysis, with optional CSS selector, depth limit, text, and attributes to inspect page structure and debug UI issues.
Instructions
Get a structured representation of the DOM tree for analysis
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"contextId": "<contextId>"
},
"name": "debug_get_dom_tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| maxDepth | No | Maximum depth to traverse in the DOM tree | |
| selector | No | CSS selector to start traversal from (default: html) | |
| contextId | Yes | Browser context ID from browser_launch | |
| includeText | No | Include text content of elements | |
| includeAttributes | No | Include element attributes |