get_selected_elements
Retrieve the DOM elements visually selected in the browser, including bulletproof selectors, context, and comments. Use this to access raw selection data or regenerate missing .dom.md context files.
Instructions
Get DOM elements that the user has visually selected in the browser for a specific script. Returns each selection's bulletproof selectors, element context, and user comments. Returns the selections in this response, so it needs no filesystem access. WRITES FILES only when you pass writeFiles: true, which saves .dom.md context files under the directory you name. Use CM_findElement with the domId for precise targeting in scripts. When MCP is connected, .dom.md context files and screenshots are automatically pushed to the workspace (.customaise/dom-context//) in real-time as the user selects elements. Use this tool to retrieve selections if the auto-pushed files are missing or to get the raw JSON data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scriptId | No | Script ID to get selections for. Omit to get all scripts' selections. | |
| directory | No | Workspace directory for .dom.md files. Required if writeFiles is true. | |
| writeFiles | No | If true, writes .dom.md context files to the workspace directory. Default: false. |