Skip to main content
Glama

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
NameRequiredDescriptionDefault
selectorYesCSS selector for element to click

Implementation Reference

  • 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, }; }
  • 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 ?? {}));

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhialsBasement/MCP-Puppeteer-Linux'

If you have feedback or need assistance with the MCP directory API, please join our Discord server