Skip to main content
Glama
Wladastic

AutoProbeMCP

by Wladastic

scroll

Scroll web pages in specified directions (up, down, left, right) with customizable pixel counts and scrolling behavior to enhance browser automation tasks.

Instructions

Scroll the page in the specified direction

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
behaviorNoScrolling behaviorauto
directionNoDirection to scrolldown
pixelsNoNumber of pixels to scroll (optional)

Implementation Reference

  • Handler function for the 'scroll' tool that parses input parameters using ScrollSchema, computes scroll distance, and executes scrolling in the specified direction using Playwright's page.evaluate method on the current page.
    case 'scroll': {
      if (!currentPage) {
        throw new Error('No browser page available. Launch a browser first.');
      }
    
      const params = ScrollSchema.parse(args);
      const { direction, pixels, behavior } = params;
    
      // Determine scroll distance
      const scrollDistance = pixels !== undefined ? pixels : 100;
    
      // Scroll the page
      await currentPage.evaluate(({ direction, scrollDistance, behavior }) => {
        let newX = window.scrollX;
        let newY = window.scrollY;
        
        switch (direction) {
          case 'down':
            newY += scrollDistance;
            break;
          case 'up':
            newY -= scrollDistance;
            break;
          case 'right':
            newX += scrollDistance;
            break;
          case 'left':
            newX -= scrollDistance;
            break;
        }
        
        window.scrollTo({
          top: newY,
          left: newX,
          behavior: behavior
        });
      }, { direction, scrollDistance, behavior });
    
      return {
        content: [
          {
            type: 'text',
            text: `Scrolled ${direction} by ${scrollDistance} pixels`
          }
        ]
      };
    }
  • Zod schema defining the input parameters for the scroll tool: direction (up/down/left/right), optional pixels, and behavior (auto/smooth).
    const ScrollSchema = z.object({
      direction: z.enum(['up', 'down', 'left', 'right']).default('down'),
      pixels: z.number().optional(),
      behavior: z.enum(['auto', 'smooth']).default('auto')
    });
  • src/index.ts:362-386 (registration)
    Registration of the 'scroll' tool in the ListTools response, including name, description, and inputSchema matching the ScrollSchema.
    {
      name: 'scroll',
      description: 'Scroll the page in the specified direction',
      inputSchema: {
        type: 'object',
        properties: {
          direction: {
            type: 'string',
            enum: ['up', 'down', 'left', 'right'],
            default: 'down',
            description: 'Direction to scroll'
          },
          pixels: {
            type: 'number',
            description: 'Number of pixels to scroll (optional)'
          },
          behavior: {
            type: 'string',
            enum: ['auto', 'smooth'],
            default: 'auto',
            description: 'Scrolling behavior'
          }
        }
      }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral context. It mentions direction but not what happens if scrolling isn't possible, whether it waits for page load, or what constitutes successful execution. For a browser interaction tool, this leaves significant behavioral unknowns.

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 description is a single, efficient sentence that communicates the core functionality without unnecessary words. It's appropriately sized for a straightforward scrolling operation and front-loads the essential action.

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

Completeness2/5

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

For a browser interaction tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens on success/failure, whether it returns anything, or how it interacts with page state. Given the complexity of browser automation, more context about behavioral expectations is needed.

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 the schema already documents all three parameters thoroughly with enums and defaults. The description adds no additional parameter semantics beyond implying directional scrolling, which is already covered in the schema's 'direction' enum. Baseline 3 is appropriate when schema does the heavy lifting.

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 action ('scroll') and target ('the page') with directional specification. It distinguishes from siblings like 'navigate' (URL changes) or 'click_element' (interactive clicks), but doesn't explicitly differentiate from 'check_scrollability' which tests rather than performs scrolling.

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 no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites like needing an active browser session, nor does it suggest using 'check_scrollability' first to verify scrollability. No explicit when/when-not instructions are provided.

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

Related 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/Wladastic/AutoProbeMCP'

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