Interactive elements
get_interaction_treeLists a page's interactive elements—buttons, links, and inputs, including shadow DOM—assigning numeric IDs usable by click and type tools instead of CSS selectors.
Instructions
List the page's interactive elements, each with a short numeric id.
The cheapest way to see what can be clicked or typed into: it walks the DOM including shadow roots for buttons, links, and inputs. The numeric ids it assigns are accepted directly by click, type_text, and the other element tools in place of a CSS selector. An id stays valid while its element exists, survives later walks, and expires on navigation; an expired one fails with stale_id. The walk runs in an isolated world and leaves no trace in the page. Returns the elements (capped at limit), the total, and whether the cap cut the list short.
Pass links=true to get each link's target as h — a path when it is
same-origin, a full URL otherwise. Following a link then means a navigate
instead of a click-and-hope, which matters when the link text is
unhelpful or missing. It is off by default because it roughly doubles the
output; measured at +116% on a 125-link search page. Nothing is emitted
for javascript: handlers, bare "#" anchors, or links back to the current
page, none of which can take you anywhere.
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": "get_interaction_tree"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Tab id from list_tabs or new_tab to act on, instead of the active tab. The active tab does not change. Omit to use the active tab. Example: 'tab_2' | |
| limit | No | Maximum number of interactive elements to return. Raise it on dense pages; a note reports when the cap was hit. Example: 150 | |
| links | No | Include each link's target as 'h' (a path when same-origin). Off by default because it roughly doubles the output; turn it on when you need to follow or identify a link. Example: true |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | How many interactive elements the page has. | |
| summary | Yes | One line saying what happened. | |
| elements | Yes | Interactive elements: id (pass to click/type_text), t type (btn, link, in, chk, rad, sel, tab, mnu, el), l label, r region (hdr, nav, main, side, ftr, dlg), and when relevant h link target, it input type, v value, ck checked, dis disabled, off offscreen. | |
| truncated | Yes | Whether `limit` cut the list short. |