Skip to main content
Glama

glass_scroll_to_element

Scroll a UI container until a specified accessibility element becomes visible, then return its id for subsequent clicks. Select by accessible name, role, or value.

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.

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). `name` and/or `role` is required.
roleNoElement role filter, e.g. "ListItem", "Button" (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}`.
value_containsNoAdditionally require the matched element's `value` to contain this substring. Not a standalone selector — `name` and/or `role` is still required.
Behavior5/5

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

No annotations are provided so the description carries the full burden, and it delivers: it discloses the text-only return, the requirement for actual visibility, the sweep-and-reverse scroll strategy, the default anchoring on the target's row/column, the step default, the timeout, the return shape, and the error when no a11y tree exists. This is rich behavioral transparency.

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 a dense but efficient paragraph that front-loads the core purpose in the first sentence. Every clause adds meaningful detail, though the phrase 'usable with glass_click_element' appears twice, a minor redundancy that prevents a perfect score.

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?

For an 8-parameter tool with no output schema, the description is remarkably complete: it explains the return object structure including the nested element and scrolled fields, the failure return, the timeout default, and the error case. It covers selection, direction, anchoring, and edge cases, leaving no major ambiguity.

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

Parameters4/5

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

Schema coverage is 100% with each parameter already described, giving a baseline of 3. The tool description adds value by explaining how parameters interact: `direction` inference falls back to a down-up sweep, `x`/`y` override the target-anchored swipe point, and `value_contains` is a non-standalone filter. That contextual coordination pushes it to a 4.

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 opens with a specific verb+resource+outcome: 'Scroll a container (any axis) until an accessibility element is on-screen, then return it.' It also distinguishes itself from sibling tools by noting the returned id is usable with glass_click_element, making the purpose unmistakable.

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?

The description explains when to use it: when an element must be actually visible (not merely in the a11y tree) and its id is needed for glass_click_element. It provides guidance on selectors, direction inference, and fallback sweep behavior, but does not explicitly name sibling alternatives or exclusion cases, so it falls just short of a 5.

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

Install Server

Other Tools

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