Skip to main content
Glama

browser_select

Select an option from a dropdown menu by providing a CSS selector and the value or label to select. Part of Browser Agent MCP for autonomous browser automation.

Instructions

Select an option from a dropdown menu

Input Schema

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

Implementation Reference

  • The main handler function that executes the browser_select tool logic. It waits for the selector to be present on the page, then selects the specified option value in the dropdown. Returns a success message or an error message.
    async function handleBrowserSelect(page: Page, args: any): Promise<{ toolResult: CallToolResult }> {
      try {
        await page.waitForSelector(args.selector);
        await page.selectOption(args.selector, args.value);
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Selected option ${args.value} in ${args.selector}`,
            }],
            isError: false,
          },
        };
      } catch (error) {
        return {
          toolResult: {
            content: [{
              type: "text",
              text: `Selection failed on ${args.selector}: ${(error as Error).message}`,
            }],
            isError: true,
          },
        };
      }
    }
  • Input schema definition for browser_select tool. Defines two required properties: 'selector' (CSS selector for the select element) and 'value' (value or label to select).
    {
      name: "browser_select",
      description: "Select an option from a dropdown menu",
      inputSchema: {
        type: "object",
        properties: {
          selector: { type: "string", description: "CSS selector for select element" },
          value: { type: "string", description: "Value or label to select" }
        },
        required: ["selector", "value"]
      }
    },
  • src/tools.ts:3-12 (registration)
    The BROWSER_TOOLS array listing 'browser_select' as a registered browser tool name.
    export const BROWSER_TOOLS = [
      "browser_navigate",
      "browser_screenshot",
      "browser_click",
      "browser_fill",
      "browser_select",
      "browser_hover",
      "browser_evaluate",
      "browser_set_viewport"
    ];
  • The switch-case dispatch in executeToolCall that routes 'browser_select' to handleBrowserSelect.
    case "browser_select":
      return await handleBrowserSelect(activePage!, args);
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as whether it waits for options to load, supports custom dropdowns, triggers events, or requires scrolling. The description is too minimal to inform the agent of important behaviors.

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

Conciseness4/5

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

The description is a single concise sentence that is front-loaded. However, it sacrifices completeness for brevity. It earns a 4 for being efficient, but could include more key details.

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 that no annotations or output schema exist, the description is insufficiently complete. It does not explain return values, constraints, or behavior for complex dropdowns, leaving gaps for an AI 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?

The input schema describes both parameters (selector and value) with 100% coverage. The description adds no additional meaning beyond the schema, so baseline score of 3 is appropriate.

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 it selects an option from a dropdown menu, using a specific verb and resource. It distinguishes from sibling tools like browser_fill (text input) and browser_click (clicking), though it could be more precise by specifying HTML <select> elements.

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 (e.g., browser_click for custom dropdowns) or any prerequisites. No exclusions or context are given.

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/imprvhub/mcp-browser-agent'

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