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);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('Select') but doesn't clarify if this is a read-only or mutating operation, what happens on success/failure (e.g., error handling), or any side effects (e.g., page state changes). This is inadequate for a tool that likely modifies page elements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded and appropriately sized for a simple tool, with every part contributing to understanding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'Select' entails (e.g., dropdown interaction, visual feedback), return values, or error conditions. For a tool with 2 parameters and likely mutating behavior, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters (selector and value) with clear descriptions. The description adds no additional meaning beyond implying these parameters are used together to select an element, which aligns with but doesn't enhance the schema information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Select') and target ('element on the page with Select tag'), which is specific enough to understand the tool's function. However, it doesn't explicitly differentiate from sibling tools like playwright_click or playwright_fill, which might also interact with page elements but serve different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., requiring an active page context), exclusions, or compare it to similar sibling tools like playwright_click for general interactions or playwright_fill for input fields, leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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