Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_click

Simulate user clicks on web page elements using CSS selectors for browser automation and testing.

Instructions

Click an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to click

Implementation Reference

  • ClickTool class implements the core handler logic for 'playwright_click' tool by executing page.click on the specified selector.
    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}`); }); }
  • Tool definition including name, description, and input schema for 'playwright_click'.
    { 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"], }, },
  • Registration and dispatch of 'playwright_click' tool call to the ClickTool instance in the main tool handler switch statement.
    case "playwright_click": return await clickTool.execute(args, context);
  • Instantiation of the ClickTool instance used for handling 'playwright_click'.
    if (!clickTool) clickTool = new ClickTool(server);
  • 'playwright_click' listed in BROWSER_TOOLS array for conditional browser launching.
    "playwright_click", "playwright_iframe_click", "playwright_iframe_fill", "playwright_fill", "playwright_select", "playwright_hover", "playwright_upload_file", "playwright_evaluate", "playwright_close", "playwright_expect_response", "playwright_assert_response", "playwright_custom_user_agent", "playwright_get_visible_text", "playwright_get_visible_html", "playwright_go_back", "playwright_go_forward", "playwright_drag", "playwright_press_key", "playwright_save_as_pdf", "playwright_click_and_switch_tab" ];

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/devskido/customed-playwright'

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