puppeteer_click
Click web page elements using CSS selectors to automate browser interactions on Linux display servers.
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)Implementation of the puppeteer_click tool handler. Clicks the element matching the given CSS selector on the page using Puppeteer and returns a 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, including name, description, and input schema requiring a 'selector' property.{ 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 the ListTools handler that exposes the puppeteer_click tool via the TOOLS array.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
- index.ts:451-451 (registration)Registration of the CallTool handler that dispatches to handleToolCall, which implements puppeteer_click.server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}));