Skip to main content
Glama

pilot_scroll

Scroll web pages to specific elements or directions using CSS selectors. Navigate to page top, bottom, or scroll up/down for browser automation tasks.

Instructions

Scroll element into view, or scroll to page bottom if no ref provided.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoElement ref or CSS selector to scroll into view
directionNoScroll direction (when no ref)

Implementation Reference

  • The handler function for the pilot_scroll MCP tool, which scrolls either a specific element into view or performs a general page scroll.
    async ({ ref, direction }) => {
      await bm.ensureBrowser();
      try {
        const page = bm.getPage();
        if (ref) {
          const resolved = await bm.resolveRef(ref);
          if ('locator' in resolved) {
            await resolved.locator.scrollIntoViewIfNeeded({ timeout: 5000 });
          } else {
            await page.locator(resolved.selector).scrollIntoViewIfNeeded({ timeout: 5000 });
          }
          bm.resetFailures();
          return { content: [{ type: 'text' as const, text: `Scrolled ${ref} into view` }] };
        }
        const scrollMap: Record<string, string> = {
          up: 'window.scrollBy(0, -window.innerHeight)',
          down: 'window.scrollBy(0, window.innerHeight)',
          top: 'window.scrollTo(0, 0)',
          bottom: 'window.scrollTo(0, document.body.scrollHeight)',
        };
        await page.evaluate(scrollMap[direction || 'bottom']);
        bm.resetFailures();
        return { content: [{ type: 'text' as const, text: `Scrolled ${direction || 'bottom'}` }] };
  • Zod schema defining the input arguments for the pilot_scroll tool.
    {
      ref: z.string().optional().describe('Element ref or CSS selector to scroll into view'),
      direction: z.enum(['up', 'down', 'top', 'bottom']).optional().describe('Scroll direction (when no ref)'),
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It successfully communicates the default behavior (scroll to bottom) when the ref parameter is omitted, but omits details about scroll behavior (smooth vs instant), error handling if the ref element is not found, or whether the operation waits for scroll completion.

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 of 12 words with zero waste. It is front-loaded with the action verb and immediately communicates the conditional logic. Every word earns its place.

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?

Given the tool's limited complexity (2 parameters, 100% schema coverage, no output schema), the description adequately covers the primary use cases and default behaviors. It appropriately leaves detailed validation rules to the schema, though it could briefly mention error conditions (e.g., invalid selector) for completeness.

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%, establishing a baseline of 3. The description adds minimal value regarding parameter semantics beyond the schema, primarily clarifying that omitting 'ref' defaults to scrolling to the page bottom. It does not add syntax details, format constraints, or validation rules beyond what the schema already documents.

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 uses specific verbs ('Scroll') and objects ('element', 'page'), clearly distinguishing this as a viewport manipulation tool separate from navigation or interaction siblings. It unambiguously states the dual functionality.

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

Usage Guidelines3/5

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

The description implies usage patterns through the conditional clause ('if no ref provided'), guiding when to pass the ref parameter versus when to omit it. However, it lacks explicit comparison to sibling tools like pilot_click that might also trigger scrolling, or when to prefer page scrolling versus element targeting.

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/TacosyHorchata/Pilot'

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