Optimize Selector
browser_optimize_selectorGet a compact unique selector for a known target element on an active page with raw capture acknowledged. Verify the result with browser_get_elements before automating.
Instructions
Use when a full-profile workflow needs a shorter unique selector for a target that is already known. Preconditions: an active page, acknowledgeRawCapture: true, and a selector matching the intended element are required. Next: verify the returned selector with browser_get_elements before relying on it in automation. Sensitivity: candidate analysis reads DOM attributes and text that may be sensitive.
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": "browser_optimize_selector"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| role | No | ||
| selector | Yes | ||
| targetIndex | No | ||
| textContains | No | ||
| candidateLimit | No | ||
| includeRejected | No | ||
| acknowledgeRawCapture | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | ||
| result | No |