Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

scroll-element

Scroll to specific elements on web pages using CSS selectors. This tool helps automate browser interactions by navigating to elements that require scrolling to access.

Instructions

Scroll the element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesThe selector of the element to scroll, find from the page source code, Simulates a user navigating page by scrolling, usually finding element in the bottom of the page

Implementation Reference

  • The main handler function for the 'scroll-element' tool. It waits for the selector, then uses page.evaluate to scroll the element into view smoothly.
    async scrollElement({ selector }: ScrollElementParams) { browser.checkConnected(); await browser.pageInstance!.waitForSelector(selector); await browser.pageInstance!.evaluate((selector) => { const element = document.querySelector(selector); if (element) { element.scrollIntoView({ behavior: 'smooth' }); } }, selector); return `Scrolled element with selector: ${selector} successfully`; },
  • Zod schema defining the input parameters for the scroll-element tool: requires a 'selector' string.
    scrollElementSchema: z.object({ selector: z.string().describe('The selector of the element to scroll, find from the page source code, Simulates a user navigating page by scrolling, usually finding element in the bottom of the page') }).strict(),
  • Registers the 'scroll-element' tool on the MCP server, providing name, description, input schema, and wrapped handler.
    server.tool('scroll-element', 'Scroll the element', schemas.scrollElementSchema.shape, wrapHandler(automationHandlers.scrollElement));

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/AdsPower/local-api-mcp-typescript'

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