Skip to main content
Glama

browser_select

Automate dropdown selections on web pages by specifying a CSS selector and the desired value or label, integrating with browser automation for efficient web interactions.

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 handler function that executes the browser_select tool using Playwright's page.selectOption method to select a dropdown option.
    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 and metadata definition for the browser_select tool.
    {
      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)
    Registers browser_select as part of the browser tools list used for tool dispatching.
    export const BROWSER_TOOLS = [
      "browser_navigate",
      "browser_screenshot",
      "browser_click",
      "browser_fill",
      "browser_select",
      "browser_hover",
      "browser_evaluate",
      "browser_set_viewport"
    ];
  • Switch case in executeToolCall that routes browser_select calls to its handler.
    case "browser_select":
      return await handleBrowserSelect(activePage!, args);
  • src/handlers.ts:61-63 (registration)
    MCP server handler for listing available tools, which includes browser_select.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: tools,
    }));
Behavior2/5

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

With no annotations, the description carries full burden but provides minimal behavioral insight. It states what the tool does but doesn't disclose execution details like error handling, timing, or visual feedback. For a browser automation tool, this lack of context on interaction behavior is a significant gap.

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's front-loaded with the core action and target, making it easy to parse quickly. Every word earns its place without redundancy or fluff.

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 browser automation and lack of annotations or output schema, the description is insufficient. It doesn't cover behavioral aspects like what happens on success/failure, whether it waits for page updates, or how it handles dynamic content. For this context, more completeness is needed.

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 parameters are fully documented in the schema. The description adds no additional meaning beyond implying 'value' corresponds to dropdown options, which is already clear from schema descriptions. Baseline 3 is appropriate as 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') and target ('an option from a dropdown menu'), making the purpose immediately understandable. It distinguishes itself from siblings like browser_click or browser_fill by specifying dropdown interaction, though it doesn't explicitly contrast with all alternatives.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a page loaded), exclusions, or comparisons to similar tools like browser_click for non-dropdown elements, leaving usage context implied rather than explicit.

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

Related 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