browsercat_click
Click elements on web pages using CSS selectors to automate interactions during browser automation sessions.
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:221-239 (handler)Handler implementation for the browsercat_click tool. It uses Puppeteer's page.click() to click the element matching the provided CSS selector, with error handling.case "browsercat_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, }; }
- index.ts:54-64 (schema)Schema definition for the browsercat_click tool, specifying the required 'selector' input parameter.{ name: "browsercat_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:421-423 (registration)Tool registration via ListToolsRequestSchema handler, which returns the TOOLS array containing browsercat_click.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS, }));
- index.ts:425-427 (registration)CallToolRequestSchema handler registration, which dispatches tool calls to handleToolCall where browsercat_click case is implemented.server.setRequestHandler(CallToolRequestSchema, async (request) => handleToolCall(request.params.name, request.params.arguments ?? {}) );