Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

click-element

Simulate clicking on web page elements using CSS selectors to automate browser interactions within AdsPower profiles.

Instructions

Click the element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesThe selector of the element to click, find from the page source code

Implementation Reference

  • The core handler function for the 'click-element' tool. It checks if the browser is connected, clicks the element using the provided CSS selector on the current page, and returns a success message.
    async clickElement({ selector }: ClickElementParams) { browser.checkConnected(); await browser.pageInstance!.click(selector); return `Clicked element with selector: ${selector} successfully`; },
  • Zod schema for input validation of the 'click-element' tool, defining a required 'selector' string parameter.
    clickElementSchema: z.object({ selector: z.string().describe('The selector of the element to click, find from the page source code') }).strict(),
  • Registers the 'click-element' tool with the MCP server, providing name, description, input schema, and wrapped handler function.
    server.tool('click-element', 'Click the element', schemas.clickElementSchema.shape, wrapHandler(automationHandlers.clickElement));

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