Skip to main content
Glama

scroll

Scroll screen content at specified coordinates in any direction. Use this macOS automation tool to navigate documents, web pages, or applications by controlling scroll behavior programmatically.

Instructions

Scroll at the specified screen coordinates in the given direction. Do not narrate visual observations or coordinate calculations. Brief task progress updates are acceptable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate in screen pixels (may be negative for secondary displays)
yYesY coordinate in screen pixels (may be negative for secondary displays)
directionYesScroll direction
amountYesScroll amount in discrete steps (default: 3)

Implementation Reference

  • The handler function for the "scroll" tool, which parses input, calculates deltas, and invokes the scroll helper.
    async function handleScroll(
      args: Record<string, unknown>,
    ): Promise<CallToolResult> {
      const parsed = ScrollInputSchema.parse(args);
      const { dx, dy } = scrollDirectionToDeltas(parsed.direction, parsed.amount);
    
      const result = await runInputHelper("scroll", {
        x: parsed.x,
        y: parsed.y,
        dx,
        dy,
      });
    
      const response: Record<string, unknown> = {
        scrolled_at: { x: parsed.x, y: parsed.y },
        direction: parsed.direction,
        amount: parsed.amount,
      };
      if (typeof result.warning === "string") {
        response.warning = result.warning;
      }
    
      return {
        content: [{ type: "text" as const, text: JSON.stringify(response) }],
      };
    }
  • Input schema definition for the "scroll" tool.
    const ScrollInputSchema = z.object({
      x: z
        .number()
        .int()
        .describe(
          "X coordinate in screen pixels (may be negative for secondary displays)",
        ),
      y: z
        .number()
        .int()
        .describe(
          "Y coordinate in screen pixels (may be negative for secondary displays)",
        ),
      direction: z.enum(SCROLL_DIRECTIONS).describe("Scroll direction"),
      amount: z
        .number()
        .int()
        .positive()
        .max(SCROLL_MAX_AMOUNT)
        .default(SCROLL_DEFAULT_AMOUNT)
        .describe(
          `Scroll amount in discrete steps (default: ${SCROLL_DEFAULT_AMOUNT})`,
        ),
    });
    
    const DragInputSchema = z.object({
      start_x: z
        .number()
        .int()
        .describe(
  • Registration of the "scroll" tool in the mouse tool definitions.
    {
      name: "scroll",
      description: `Scroll at the specified screen coordinates in the given direction. ${SILENT_HINT}`,
      inputSchema: zodToToolInputSchema(ScrollInputSchema),
      annotations: {
        readOnlyHint: false,
        destructiveHint: false,
      },
    },
Behavior3/5

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

Annotations indicate readOnlyHint=false and destructiveHint=false, covering basic safety. The description adds behavioral context about output constraints ('Do not narrate visual observations...'), which is valuable beyond annotations. However, it doesn't disclose other traits like performance implications, error conditions, or side effects. With annotations providing safety info, the description adds some but not extensive 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 concise and front-loaded: the first sentence states the core purpose, followed by two sentences on output constraints. Each sentence adds value without redundancy. It could be slightly more structured by separating purpose from guidelines, but overall it's efficient with minimal waste.

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

Completeness3/5

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

Given 4 parameters with full schema coverage, annotations covering safety, and no output schema, the description is moderately complete. It explains the tool's action and output behavior but lacks context on when to use it relative to siblings, potential errors, or real-world examples. For a screen interaction tool with rich schema, this is adequate but has clear gaps in usage guidance.

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%, with each parameter well-documented in the schema (e.g., x/y coordinates in pixels, direction enum, amount as steps). The description doesn't add any parameter-specific semantics beyond what the schema provides, such as explaining coordinate systems or scroll behavior. Baseline score of 3 is appropriate since the schema carries the full burden.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Scroll at the specified screen coordinates in the given direction.' It specifies the verb ('scroll'), resource ('screen coordinates'), and direction, but doesn't explicitly differentiate from sibling tools like 'drag' or 'move_mouse' that also involve screen interaction. The description is specific but lacks sibling differentiation for a perfect score.

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

Usage Guidelines2/5

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

The description provides minimal usage guidance: 'Do not narrate visual observations or coordinate calculations. Brief task progress updates are acceptable.' This addresses output behavior rather than when to use this tool versus alternatives. No explicit guidance on when to choose 'scroll' over other interaction tools like 'drag' or 'click' is provided, leaving the agent with little context for tool selection.

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/antbotlab/mac-use-mcp'

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