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
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | The 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
- src/handlers/automation.ts:80-84 (handler)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`; },
- src/types/schemas.ts:182-184 (schema)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(),
- src/utils/toolRegister.ts:68-69 (registration)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));