Skip to main content
Glama

browser_scroll_to_top

Scroll to the top of the page during web automation. Use this tool to return to the page's starting position for consistent testing or navigation.

Instructions

Scroll to the top of the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The inline handler and registration for the 'browser_scroll_to_top' tool. It retrieves the WebDriver from StateManager, instantiates ActionService, and calls scrollToTop().
    server.tool('browser_scroll_to_top', 'Scroll to the top of the page', {}, async () => { try { const driver = stateManager.getDriver(); const actionService = new ActionService(driver); await actionService.scrollToTop(); return { content: [{ type: 'text', text: `Scrolled to top of the page` }], }; } catch (e) { return { content: [ { type: 'text', text: `Error scrolling to top: ${(e as Error).message}`, }, ], }; } });
  • The supporting method in ActionService that executes the JavaScript 'window.scrollTo(0, 0);' to scroll to the top of the page using the WebDriver.
    async scrollToTop(): Promise<void> { await this.driver.executeScript('window.scrollTo(0, 0);'); }

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/pshivapr/selenium-mcp'

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