Skip to main content
Glama

glass_scroll_to_element

Scrolls a native GUI container until a target element is visible on-screen, using selectors like role, name, or value. Returns match status, elapsed time, and scroll details.

Instructions

Scroll until a semantic element is actually on-screen; returns matched, elapsed_ms, element and scrolled details. 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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoWindow-relative anchor x; supply both x/y for a container. Default target row/column, or window center if absent.
yNoScroll anchor y (window-relative). See `x`.
nameNoSubstring of the target element's accessible name (selector).
roleNoElement role filter, e.g. "ListItem", "Button", "Document" (selector).
stepNoWheel notches per step (default 3); large steps can skip realized rows.
directionNoup/down/left/right. Default infers off-screen direction, or down then up if absent. Reverses at the first end.
timeout_msNoTimeout in ms (default 20000). Standalone: matched:false; batched: fails the sequence.
descriptionNoAccessible-description substring; can select unnamed controls.
value_containsNoValue substring; requires name, description and/or role.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.8.0
    • changedInput schema / properties / description / description
      Previous value: -"Substring of the target element's accessible description (selector). This can select\nan unnamed control, including an Android text field labelled only by its hint."New value: +"Accessible-description substring; can select unnamed controls."
    • changedInput schema / properties / direction / description
      Previous value: -"Sweep direction: \"up\"/\"down\" (vertical) or \"left\"/\"right\" (horizontal).\nOmit to infer it from the target's off-screen position (falls back to a\nvertical down→up sweep when the target isn't in the a11y tree yet). The\nsearch reverses to the other end if the target isn't found first."New value: +"up/down/left/right. Default infers off-screen direction, or down then up if absent. Reverses at the first end."
    • changedInput schema / properties / step / description
      Previous value: -"Wheel notches per scroll step (default 3). A calibration escape hatch — larger\ncovers distance faster but risks stepping past a row's/column's realized band."New value: +"Wheel notches per step (default 3); large steps can skip realized rows."
    • changedInput schema / properties / timeout_ms / description
      Previous value: -"Give up after this long (default 20000ms); returns `{matched:false}`."New value: +"Timeout in ms (default 20000). Standalone: matched:false; batched: fails the sequence."
    • changedInput schema / properties / value_contains / description
      Previous value: -"Additionally require the matched element's `value` to contain this substring.\nNot a standalone selector — `name`, `description`, and/or `role` is still required."New value: +"Value substring; requires name, description and/or role."
    • changedInput schema / properties / x / description
      Previous value: -"Scroll anchor x (window-relative). By default the swipe anchors on the target's\nown row/column (falling back to the window center if it isn't in the a11y tree\nyet); set both `x` and `y` to point the wheel at a specific container instead."New value: +"Window-relative anchor x; supply both x/y for a container. Default target row/column, or window center if absent."
  2. Changed4 schema fields changedv1.5.1
    • addedInput schema / properties / description
      Added value: +{
      +  "description": "Substring of the target element's accessible description (selector). This can select\nan unnamed control, including an Android text field labelled only by its hint.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Substring of the target element's accessible name (selector). `name` and/or\n`role` is required."New value: +"Substring of the target element's accessible name (selector)."
    • changedInput schema / properties / role / description
      Previous value: -"Element role filter, e.g. \"ListItem\", \"Button\" (selector)."New value: +"Element role filter, e.g. \"ListItem\", \"Button\", \"Document\" (selector)."
    • changedInput schema / properties / value_contains / description
      Previous value: -"Additionally require the matched element's `value` to contain this substring.\nNot a standalone selector — `name` and/or `role` is still required."New value: +"Additionally require the matched element's `value` to contain this substring.\nNot a standalone selector — `name`, `description`, and/or `role` is still required."
  3. Changed1 schema field changedv1.2.0
    • removedInput schema / title
      Removed value: -"ScrollToElementArgs"
  4. Addedv1.1.0
  5. Removedv1.0.3
  6. Addedv1.0.3
  7. Removedv1.0.2
  8. First observedv1.0.1

TDQS

A4.4/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses sweep-then-reverse behavior, return fields, timeout and end-of-scroll failure modes, the absence of tree errors, and batched sequence failure semantics. The annotations are sparse, so this description carries the behavioral burden effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Roughly sixty words, front-loaded with the core action, followed by return values, failure modes, batched behavior, and a routing note. Every sentence contributes information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers action, return fields, direction handling, timeout behavior, failure semantics, and sibling routing despite having no output schema. Minor gaps remain around what 'on-screen' means exactly and the shape of the returned element, but the context is strong for a complex automation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3 and the description need not re-explain parameters. It adds useful context about direction sweeping and timeout behavior, but no per-parameter semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Scroll until a semantic element is actually on-screen'. It clearly distinguishes the tool from glass_do by naming the alternative, and the unique role is evident from the description alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear context for when to use the tool and explicitly routes the user to glass_do for '2+ known steps'. It could more fully contrast with sibling scroll/find tools, but the main alternative is covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.