Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_click

Automate clicking on web elements using CSS selectors with Playwright MCP Server, enabling browser interaction for testing, scraping, and automation tasks.

Instructions

Click an element on the page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element to click

Implementation Reference

  • The ClickTool class provides the core handler logic for the 'playwright_click' tool, executing page.click on the provided 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}`); }); } }
  • Input schema definition for the 'playwright_click' tool, specifying the required 'selector' parameter.
    { 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 dispatching of the 'playwright_click' tool in the main tool handler switch statement, routing to ClickTool.execute.
    case "playwright_click": return await clickTool.execute(args, context);
  • Instantiation and initialization of the ClickTool instance used for handling 'playwright_click' calls.
    if (!clickTool) clickTool = new ClickTool(server);
  • Import of ClickTool from interaction.ts, enabling its use in the tool handler.
    endCodegenSession, getCodegenSession, clearCodegenSession } from './tools/codegen/index.js'; import { ScreenshotTool, NavigationTool, CloseBrowserTool,

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