glass_scroll_to_element
Scrolls a UI until a semantic element matching name, role, description, or value is visible on-screen, reporting match and scroll details and reversing at scroll edges.
Instructions
Scroll until a semantic element is actually on-screen; returns matched, elapsed_ms, element and scrolled details. subject_mismatch flags a different app, named by subject in the untrusted block even without an element. Sweeps the chosen/inferred direction, then reverses. No match after both ends or timeout returns matched:false; no tree errors. Batched use fails the sequence on an unmatched predicate. For 2+ known steps, use glass_do.
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": "glass_scroll_to_element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Window-relative anchor x; supply both x/y for a container. Default target row/column, or window center if absent. | |
| y | No | Scroll anchor y (window-relative). See `x`. | |
| name | No | Substring of the target element's accessible name (selector). | |
| role | No | Element role filter, e.g. "ListItem", "Button", "Document" (selector). | |
| step | No | Wheel notches per step (default 3); large steps can skip realized rows. | |
| direction | No | up/down/left/right. Default infers off-screen direction, or down then up if absent. Reverses at the first end. | |
| timeout_ms | No | Timeout in ms (default 20000). Standalone: matched:false; batched: fails the sequence. | |
| description | No | Accessible-description substring; can select unnamed controls. | |
| value_contains | No | Value substring; requires name, description and/or role. |