Skip to main content
Glama

playwright_click

Execute clicks on web page elements using a CSS selector. Enables browser automation for precise interactions within a real browser environment via Playwright.

Instructions

Click an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to click

Implementation Reference

  • The ClickTool class implements the core execution logic for the 'playwright_click' tool by calling `page.click(args.selector)` within a safe execution wrapper.
    export class ClickTool extends BrowserToolBase { /** * Execute the click tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (page) => { await page.click(args.selector); return createSuccessResponse(`Clicked element: ${args.selector}`); }); } }
  • Defines the input schema, name, and description for the 'playwright_click' tool.
    { name: "playwright_click", description: "Click an element on the page", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for the element to click" }, }, required: ["selector"], }, },
  • Registers and dispatches 'playwright_click' tool calls to the ClickTool instance's execute method.
    case "playwright_click": return await clickTool.execute(args, context);
  • Instantiates the ClickTool instance used for handling 'playwright_click'.
    if (!clickTool) clickTool = new ClickTool(server);
  • Includes 'playwright_click' in the BROWSER_TOOLS array for conditional browser launching.
    "playwright_click",

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/executeautomation/mcp-playwright'

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