Skip to main content
Glama
Wladastic

AutoProbeMCP

by Wladastic

scroll

Scroll a web page in any direction—up, down, left, or right—with optional pixel distance and smooth or automatic animation behavior.

Instructions

Scroll the page in the specified direction

Input Schema

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

Implementation Reference

  • Zod schema for the 'scroll' tool: defines direction (up/down/left/right, default 'down'), pixels (optional number), and behavior (auto/smooth, default 'auto').
    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)
    Tool registration for 'scroll' in the ListToolsRequestSchema handler. Provides name, description, and inputSchema with direction, pixels, and behavior fields.
    {
      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'
          }
        }
      }
    },
  • Handler for the 'scroll' tool in the CallToolRequestSchema. Parses args via ScrollSchema, computes scroll distance (default 100px), uses page.evaluate to scroll via window.scrollTo, and returns a text result.
    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`
          }
        ]
      };
    }
Behavior2/5

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

Without annotations, the description must disclose behavioral traits. It only states the basic action, omitting details like whether scrolling can overflow, if it’s allowed on any element, or if it returns a result. No side effects or limitations are mentioned.

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, front-loaded sentence with no extraneous words. It efficiently conveys the core purpose.

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?

Given the lack of annotations and output schema, the description is insufficient. It fails to mention crucial details like the requirement for a scrollable element, possible failure modes, or the effect on the viewport. A more complete description would address these gaps.

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 coverage is 100%, so the baseline is 3. The description adds no extra meaning beyond the schema; the schema already documents direction, pixels, and behavior enums. No additional context or usage hints are provided.

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 the resource ('page'), along with the parameter ('specified direction'). It is distinct from sibling tools like 'check_scrollability' and 'click_element', but does not elaborate on the effect (e.g., viewport movement).

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?

No guidance is provided on when to use this tool versus alternatives such as 'evaluate_javascript' for custom scrolling or 'click_element' to trigger scrollable areas. The description lacks context for decision-making.

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

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