a11y-toolkit: Locate element by accessible name
a11y_locateFind an element by its accessible name and return its deterministic route selector for code edits and panel deep-links; ambiguous names return candidate lists instead of guesses.
Instructions
Find an element by its accessible name and get its deterministic route selector (the same tag:nth-of-type identity annotate() uses): controls, headings, images with alt, iframes with title, fields with an explicit name. High confidence only on exact unique matches; when several elements share the name it refuses to pick one and returns the full candidate list (ambiguous) — a match is never invented. Feeds agents that edit code by selector and panel deep-links.
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": {
"html": "<html>",
"query": "<query>"
},
"name": "a11y_locate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | raw HTML to search | |
| lang | No | output language (en default) | |
| role | No | filter by role: button, link, textbox, checkbox, radio, combobox, heading, h1-h6, image… | |
| query | Yes | accessible name to find (e.g. "Submit") | |
| multiple | No | list every exact match instead of refusing (default false) |