Skip to main content
Glama

scroll

Scroll the page or a container by a pixel amount in any direction, or bring an element into view. Returns the new position and max scroll so you can detect when the end is reached.

Instructions

Scroll the page, or a scrollable container, by an amount in a direction; or scroll a given element (ref, selector or match) into the centre of the view. Returns the new scroll position and the maximum scroll, so you can tell when you reached the end. Use it for lazy-loaded or long pages; click and hover already scroll their target into view, so you rarely need it for those.

Input Schema

NameRequiredDescriptionDefault
refNoElement ref from the latest snapshot or find, e.g. "e12". Preferred: unambiguous and fastest; stale after navigation.
tabNoTab id from tabs_list. Defaults to the current tab.
matchNoVisible text or accessible name to match (case-insensitive substring), e.g. "Sign up"; use when you have no ref.
amountNoDistance in CSS pixels (default 600).
withinNoCSS selector of a scrollable container (e.g. a modal or list) to scroll instead of the window.
selectorNoCSS selector; the first matching element is used.
directionNoScroll direction (default down). Ignored when an element is given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.2
    • changedInput schema / properties / amount / description
      Previous value: -"Pixels (default 600)."New value: +"Distance in CSS pixels (default 600)."
    • changedInput schema / properties / direction / description
      Previous value: -"Direction (default down)."New value: +"Scroll direction (default down). Ignored when an element is given."
    • changedInput schema / properties / match / description
      Previous value: -"Visible text / accessible name to match (case-insensitive substring)."New value: +"Visible text or accessible name to match (case-insensitive substring), e.g. \"Sign up\"; use when you have no ref."
    • changedInput schema / properties / ref / description
      Previous value: -"Element ref from snapshot/find, e.g. \"e12\". Preferred."New value: +"Element ref from the latest snapshot or find, e.g. \"e12\". Preferred: unambiguous and fastest; stale after navigation."
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector (first match)."New value: +"CSS selector; the first matching element is used."
    • changedInput schema / properties / within / description
      Previous value: -"CSS selector of a scroll container instead of the window."New value: +"CSS selector of a scrollable container (e.g. a modal or list) to scroll instead of the window."
  2. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only give readOnlyHint=false and openWorldHint=true; the description adds genuine behavioral context by disclosing the return payload (new scroll position and maximum scroll, so you can tell when you reached the end) and by clarifying that click/hover auto-scroll. It does not contradict the annotations. It stops just short of noting rate/lazy-load timing caveats, so a 4 rather than a 5.

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?

The core action is front-loaded in the first clause, the two modes follow, and the closing sentence carries non-obvious routing advice. No sentence is filler and nothing important is buried.

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?

There is no output schema, but the description compensates by explaining what is returned (new scroll position and max scroll). For a 7-parameter, all-optional tool the coverage is strong; only minor edge cases (e.g. behavior when no scrollable area exists) are unaddressed.

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 description coverage is 100%, so every parameter (ref, tab, match, amount, within, selector, direction) is already fully documented, including the default amount of 600 and that direction is ignored when an element is given. The description groups these into two usage modes but adds no syntax or format detail beyond the schema, so the baseline 3 applies.

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 ("Scroll") and clearly delineates its two distinct modes: scrolling by an amount in a direction, and scrolling a given element (ref, selector or match) into the centre of the view. This is far more precise than the bare tool name and lets an agent distinguish it from siblings like click or hover.

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 states when to reach for it ("lazy-loaded or long pages") and when not to ("click and hover already scroll their target into view, so you rarely need it for those"). Naming the siblings whose behavior overlaps is exactly the routing guidance an agent needs.

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