Selectors for an element
collect_selectorsFinds every CSS selector that can reach a target element from a hint, text, accessible name, or annotation, ranks them by redeploy survival, and checks live matches for uniqueness.
Instructions
Given a description or a CSS hint, returns every selector that could reach the element, ranked by how likely it is to survive a redeploy and checked against the live page so you know whether it matches one element or several. Prefer the top result. A selector built on a generated class such as css-1x2y3z is scored down because it changes whenever the bundler runs.
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": "collect_selectors"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | A CSS selector, visible text, or an accessible name identifying the element. | |
| element | No | A number from the most recent annotate_interactive on this tab. Easier and safer than retyping a selector. |