Skip to main content
Glama
AdsPower

AdsPower LocalAPI MCP Server

Official

click-element

Use this tool to programmatically click a specified element on a webpage by providing its selector, enabling automated interactions with AdsPower browser profiles.

Instructions

Click the element

Input Schema

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

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "selector": { "description": "The selector of the element to click, find from the page source code", "type": "string" } }, "required": [ "selector" ], "type": "object" }

Implementation Reference

  • The main handler function that performs the click action on the specified element selector using the browser's page instance.
    async clickElement({ selector }: ClickElementParams) { browser.checkConnected(); await browser.pageInstance!.click(selector); return `Clicked element with selector: ${selector} successfully`; },
  • Zod schema defining the input shape for the click-element tool: an object with a required 'selector' string field.
    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 the 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