Skip to main content
Glama

browser_select_option

Select a specific option from dropdown elements in web browsers using element selectors and values to automate form interactions or UI testing.

Instructions

Select an option from a dropdown

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdYesInstance ID
selectorYesElement selector
valueYesValue to select
timeoutNoTimeout in milliseconds

Implementation Reference

  • The main handler function that executes the browser_select_option tool by calling Playwright's page.selectOption method on the specified selector with the given value.
    private async selectOption(instanceId: string, selector: string, value: string, timeout: number): Promise<ToolResult> {
      const instance = this.browserManager.getInstance(instanceId);
      if (!instance) {
        return { success: false, error: `Instance ${instanceId} not found` };
      }
    
      try {
        await instance.page.selectOption(selector, value, { timeout });
        return {
          success: true,
          data: { selector, value, selected: true },
          instanceId
        };
      } catch (error) {
        return {
          success: false,
          error: `Select option failed: ${error instanceof Error ? error.message : error}`,
          instanceId
        };
      }
    }
  • The input schema and metadata (name, description) for the browser_select_option tool, used for validation and MCP registration.
    name: 'browser_select_option',
    description: 'Select an option from a dropdown',
    inputSchema: {
      type: 'object',
      properties: {
        instanceId: {
          type: 'string',
          description: 'Instance ID'
        },
        selector: {
          type: 'string',
          description: 'Element selector',
        },
        value: {
          type: 'string',
          description: 'Value to select',
        },
        timeout: {
          type: 'number',
          description: 'Timeout in milliseconds',
          default: 30000
        }
      },
      required: ['instanceId', 'selector', 'value']
    }
  • src/tools.ts:550-552 (registration)
    The dispatch case in the executeTools method that routes calls to the selectOption handler.
    case 'browser_select_option':
      return await this.selectOption(args.instanceId, args.selector, args.value, args.timeout || 30000);
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 states the action but doesn't cover critical aspects like error handling (e.g., what happens if the dropdown isn't found), side effects (e.g., page changes), or performance traits (e.g., timeout behavior beyond the schema). 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 with zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 a browser interaction tool with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, error cases, and output expectations, which are crucial for safe and effective tool invocation in this context.

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 all parameters (instanceId, selector, value, timeout). The description implies the 'value' parameter is used to select an option but doesn't add meaning beyond the schema, such as format examples or interaction details. Baseline 3 is appropriate when the schema does the heavy lifting.

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 option') and the target ('from a dropdown'), which is specific and distinguishes it from siblings like browser_click or browser_fill that perform different browser interactions. However, it doesn't explicitly differentiate from potential similar tools like browser_fill for dropdowns, keeping it at 4 rather than 5.

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 browser instance), exclusions, or compare it to siblings like browser_click for non-dropdown elements or browser_fill for text inputs, 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/sailaoda/concurrent-browser-mcp'

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