query_dom
Query DOM elements by CSS selector to return structure, attributes, bounding rectangles, and computed styles for inspecting page content and layout.
Instructions
Query DOM elements by CSS selector, returning structure, attributes, bounding rect and, with properties, computed styles. Use it when you already have a selector (no match: count 0); to find one, get_interactives or find_text; for the rule that set a style, get_css_styles.
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": {
"selector": "<selector>"
},
"name": "query_dom"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max elements returned, from the top of the match list | |
| tab_id | No | Target tab; omitted = last tab navigated in this session, else the active one | |
| frame_id | No | Target iframe id from get_frames; omitted = main frame | |
| selector | Yes | CSS selector; ">>>" pierces shadow DOM. Matches all, not just the first | |
| properties | No | Computed styles to include, e.g. ["color"] |