Skip to main content
Glama

glass_scroll_to_element

Scroll any container until a matching accessibility element is on-screen and return its clickable ID. Select by name, role, description, or value; direction is inferred or can be set.

Instructions

Scroll a container (any axis) until an accessibility element is on-screen, then return it (text-only, no image). Requires the element to be actually visible — not merely present in the a11y tree — so the returned id is usable with glass_click_element. Select by name (accessible-name substring) and/or role (e.g. "Button"); optional value_contains. direction: "up"/"down"/"left"/"right"; omit to infer it from the target's off-screen position (falls back to a vertical down→up sweep when the target isn't in the tree yet). It sweeps that way to the end, then reverses. Optional x,y aim the swipe at a specific container; by default it anchors on the target's own row/column so a container that isn't window-centered (e.g. a top toolbar) is still driven. step sets wheel notches per move (default 3). Returns {matched,elapsed_ms,element{id,role,name,bounds,states},scrolled{steps,reversed,direction}} — the id is usable with glass_click_element. Returns {matched:false} if it never becomes visible after sweeping both ends or timeout_ms (default 20000). Errors if the app exposes no accessibility tree. If at least two next actions or waits are known, use glass_do instead of separate calls.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xNoScroll anchor x (window-relative). By default the swipe anchors on the target's own row/column (falling back to the window center if it isn't in the a11y tree yet); set both `x` and `y` to point the wheel at a specific container instead.
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 scroll step (default 3). A calibration escape hatch — larger covers distance faster but risks stepping past a row's/column's realized band.
directionNoSweep direction: "up"/"down" (vertical) or "left"/"right" (horizontal). Omit to infer it from the target's off-screen position (falls back to a vertical down→up sweep when the target isn't in the a11y tree yet). The search reverses to the other end if the target isn't found first.
timeout_msNoGive up after this long (default 20000ms); returns `{matched:false}`.
descriptionNoSubstring of the target element's accessible description (selector). This can select an unnamed control, including an Android text field labelled only by its hint.
value_containsNoAdditionally require the matched element's `value` to contain this substring. Not a standalone selector — `name`, `description`, and/or `role` is still required.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 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."
  2. Changed1 schema field changedv1.2.0
    • removedInput schema / title
      Removed value: -"ScrollToElementArgs"
  3. Addedv1.1.0
  4. Removedv1.0.3
  5. Addedv1.0.3
  6. Removedv1.0.2
  7. First observedv1.0.1

TDQS

A4.6/5.0
Behavior5/5

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

The description goes well beyond the annotations by disclosing the visible-not-merely-present requirement, the sweep-and-reverse search strategy, fallback direction inference, anchoring behavior, text-only return, timeout behavior, and error case. This is exactly the operational context an agent needs and is not available from readOnlyHint/destructiveHint.

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

Conciseness4/5

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

The description is dense but front-loaded with the core purpose, then parameter behavior, then return contract and alternatives. Every sentence carries operational value for a 9-parameter tool, though the single-paragraph format is long and could be improved with clearer structural breaks.

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

Completeness5/5

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

Given the tool has 9 parameters, no output schema, and no nested objects, the description covers selectors, direction inference, sweep-reversal, anchor defaults, step, timeout, return shape, error conditions, and the glass_do alternative. An agent has enough to decide when to call it and what to expect.

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?

Parameter semantics are already fully documented in the schema (100% coverage), including defaults for `step`, `timeout_ms`, and validation that `value_contains` is not standalone. The description summarizes some of this behavior but does not substantially add new parameter meaning 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?

The description states a specific action (scroll any axis), a resource (container/element), and the outcome (element returned as text-only with usable id for glass_click_element). It clearly distinguishes itself from generic scrolling and clicking siblings by framing the purpose around finding a visible accessibility element.

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

Usage Guidelines5/5

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

It explicitly explains when the tool is appropriate — when an element must actually be visible for a later click — and routes to an alternative: 'If at least two next actions or waits are known, use glass_do instead of separate calls.' It also states a hard failure condition (no accessibility tree), giving agents a clear signal for when not to call it.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fixed-width/glass'

If you have feedback or need assistance with the MCP directory API, please join our Discord server