Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

playwright_select

Select specific options from dropdown menus on web pages using CSS selectors and values to automate form interactions and data entry.

Instructions

Select an element on the page with Select tag

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for element to select
valueYesValue to select

Implementation Reference

  • The SelectTool class implements the execution handler for the 'playwright_select' tool. It waits for the selector, selects the specified option using Playwright's selectOption method, and returns a success response.
    export class SelectTool extends BrowserToolBase { /** * Execute the select tool */ async execute(args: any, context: ToolContext): Promise<ToolResponse> { return this.safeExecute(context, async (page) => { await page.waitForSelector(args.selector); await page.selectOption(args.selector, args.value); return createSuccessResponse(`Selected ${args.selector} with: ${args.value}`); }); } }
  • The input schema definition for the 'playwright_select' tool, specifying the required 'selector' and 'value' parameters.
    { name: "playwright_select", description: "Select an element on the page with Select tag", inputSchema: { type: "object", properties: { selector: { type: "string", description: "CSS selector for element to select" }, value: { type: "string", description: "Value to select" }, }, required: ["selector", "value"], }, },
  • Dispatch/registration of the 'playwright_select' tool handler in the main tool call switch statement, routing to selectTool.execute.
    case "playwright_select": return await selectTool.execute(args, context);
  • Instantiation of the SelectTool instance in the initializeTools function, which is called before handling tool calls.
    if (!selectTool) selectTool = new SelectTool(server);
  • Helper case in codegen generator for handling 'playwright_select' actions when generating Playwright test code.
    case 'playwright_select': return this.generateSelectStep(parameters);

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