puppeteer_click
Automate browser interactions by programmatically clicking elements using a CSS selector for precise targeting, enabled by Puppeteer on a Linux server.
Instructions
Click an element on the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for element to click |
Implementation Reference
- index.ts:260-279 (handler)The handler logic for the 'puppeteer_click' tool. It attempts to click on the element specified by the CSS selector and returns success or error message.case "puppeteer_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.message}`, }], isError: true, }; }
- index.ts:128-138 (schema)Schema definition for the 'puppeteer_click' tool, specifying the input parameters including the required CSS selector.{ name: "puppeteer_click", description: "Click an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to click" }, }, required: ["selector"], }, },
- index.ts:447-449 (registration)Registration of all tools including 'puppeteer_click' via the TOOLS array in the ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));