Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

scroll-element

Simulate user interaction by scrolling to a specified element on a webpage using its selector, enabling automated navigation and access to content in AdsPower LocalAPI MCP Server workflows.

Instructions

Scroll the element

Input 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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "selector": { "description": "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", "type": "string" } }, "required": [ "selector" ], "type": "object" }

Implementation Reference

  • The core handler function that executes the scroll-element tool. It waits for the element by selector, then uses evaluate to call scrollIntoView on it.
    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 for input validation of scroll-element tool, requiring 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 with the MCP server, providing name, description, input schema, and wrapped handler reference.
    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