find_relative
Finds an element spatially relative to an anchor—above, below, left, right, or nearest—to locate values near labels such as a total below a heading.
Instructions
[Agent Browser] Find an element spatially relative to an anchor element. Directions: 'above', 'below', 'left', 'right', 'nearest'. Use for finding data near labels (e.g., value below "Total Gain" label). Returns the closest matching element in that direction.
Note: 'anchor' uses Playwright selectors (text=, css, xpath). 'target' can be: - CSS selector (div, .class, #id) - 'text' - find nearest element with direct text content (recommended for values) - None/omitted - searches all elements (may find containers)
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": {
"anchor": "<anchor>",
"direction": "<direction>"
},
"name": "find_relative"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anchor | Yes | ||
| target | No | ||
| direction | Yes | ||
| max_distance | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| hints | No | ||
| message | No | ||
| success | No | ||
| suggestions | No |