Skip to main content
Glama

playwright_select

Select options from dropdown menus on web pages using CSS selectors and specified values for browser automation tasks.

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.execute method implements the core logic of the 'playwright_select' tool, waiting for the selector and calling page.selectOption.
    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, defining 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"],
      },
    },
  • Registration and dispatch of the 'playwright_select' tool in the main tool handler switch statement, calling the SelectTool's execute method.
    case "playwright_select":
      return await selectTool.execute(args, context);
  • Instantiation of the SelectTool instance used for handling 'playwright_select' tool calls.
    if (!selectTool) selectTool = new SelectTool(server);
  • Code generation helper method that produces Playwright test code for the 'playwright_select' tool action.
    private generateSelectStep(parameters: Record<string, unknown>): string {
      const { selector, value } = parameters;
      return `
      // Select option
      await page.selectOption('${selector}', '${value}');`;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Select an element' but doesn't explain what this entails (e.g., does it trigger events, require the element to be visible, or have side effects like page navigation?). This is inadequate for a mutation tool with zero annotation coverage.

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 appropriately sized and front-loaded, with every word contributing to clarity.

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 complexity of interacting with web elements and the lack of annotations or output schema, the description is insufficient. It doesn't cover behavioral aspects like error handling, return values, or dependencies on other tools (e.g., needing playwright_get first), leaving significant gaps for the agent.

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%, with clear descriptions for both parameters (selector and value). The description adds no additional meaning beyond what the schema provides, such as examples or constraints, so it meets the baseline of 3 for high schema coverage.

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 an element') and the target ('on the page with Select tag'), which is a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like playwright_click or playwright_fill, which also interact with page elements, so it lacks sibling differentiation.

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., needing an active page), exclusions, or comparisons to other playwright tools that might handle similar interactions, leaving the agent without context for selection.

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