click
Automate clicks on web page elements using CSS selectors to test consent management platforms and browser interactions in the Autoconsent MCP server environment.
Instructions
Click elements on the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for element to click |
Implementation Reference
- src/index.ts:283-305 (handler)The switch case in handleToolCall that implements the 'click' tool by calling page.click on the given CSS selector, with success/error response handling.case "click": try { await page.click(args.selector); return { content: [ { type: "text", text: `Clicked: ${args.selector}`, }, ], isError: false, }; } catch (error) { return { content: [ { type: "text", text: `Failed to click ${args.selector}: ${(error as Error).message}`, }, ], isError: true, }; }
- src/index.ts:65-78 (registration)Registration of the 'click' tool in the TOOLS array, including name, description, and input schema definition.{ name: "click", description: "Click elements on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to click", }, }, required: ["selector"], }, },
- src/index.ts:68-77 (schema)Input schema for the 'click' tool, defining the required 'selector' parameter.inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to click", }, }, required: ["selector"], },