Skip to main content
Glama

browser_scroll_to_top

Scroll to the top of the current web page to access navigation menus, refresh content, or return to page headers during automated browser testing.

Instructions

Scroll to the top of the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for browser_scroll_to_top, which instantiates ActionService and invokes its scrollToTop method, handling success and error responses.
    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}`, }, ], }; } });
  • Core implementation of scrolling to the top of the page using Selenium WebDriver's executeScript to run 'window.scrollTo(0, 0)'.
    async scrollToTop(): Promise<void> { await this.driver.executeScript('window.scrollTo(0, 0);'); }
  • Registration of action tools (including browser_scroll_to_top) via call to registerActionTools in the central tools registration function.
    registerActionTools(server, stateManager);

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