scroll_down
Scrolls down web pages by a specified pixel amount or one full page to view content below the current viewport.
Instructions
Scroll down the page by a pixel amount - if no pixels are specified, scrolls down one page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pixels | No | The number of pixels to scroll down. If not specified, scrolls down one page. |
Implementation Reference
- src/index.ts:781-800 (handler)The main handler function that executes the scroll_down tool. It scrolls the page down by the specified number of pixels using window.scrollBy, or presses PageDown if no pixels are provided.async function handleScrollDown( page: Page, args: any ): Promise<CallToolResult> { const { pixels } = args; if (pixels !== undefined) { await page.evaluate((scrollAmount) => { window.scrollBy(0, scrollAmount); }, pixels); } else { await page.keyboard.press("PageDown"); } return { isError: false, content: [ { type: "text", text: `Scrolled down by ${pixels ?? "one page"}` }, ], }; }
- src/index.ts:522-537 (schema)The tool definition including name, description, and input schema for the scroll_down tool. Pixels is an optional integer parameter.{ name: "scroll_down", description: "Scroll down the page by a pixel amount - if no pixels are specified, scrolls down one page", inputSchema: { type: "object", properties: { pixels: { type: "integer", description: "The number of pixels to scroll down. If not specified, scrolls down one page.", }, }, required: [], }, },
- src/index.ts:928-929 (registration)The switch case in the main tool dispatcher (handleToolCall) that routes scroll_down calls to the handleScrollDown function.case "scroll_down": result = await handleScrollDown(page, args);