Skip to main content
Glama

browser_select

Select dropdown elements on web pages using CSS selectors to automate form interactions during penetration testing.

Instructions

Select an element on the page with Select tag using CSS selector

Input Schema

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

Implementation Reference

  • Executes the browser_select tool: selects an option in a select element using CSS selector and value, includes error handling for strict mode violations with retry on first matching element.
    case ToolName.BrowserSelect:
      try {
        await page.locator(args.selector).selectOption(args.value);
        return {
          content: [{
            type: "text",
              text: `Selected ${args.selector} with: ${args.value}`,
            }],
          isError: false,
        };
      } catch (error) {
        if((error as Error).message.includes("strict mode violation")) {
            console.log("Strict mode violation, retrying on first element...");
            try {
                await page.locator(args.selector).first().selectOption(args.value);
                return {
                    content: [{
                        type: "text",
                        text: `Selected ${args.selector} with: ${args.value}`,
                    }],
                    isError: false,
                };
            } catch (error) {
                return {
                    content: [{
                        type: "text",
                        text: `Failed (twice) to select ${args.selector}: ${(error as Error).message}`,
                    }],
                    isError: true,
                };
            }
        }
        return {
          content: [{
            type: "text",
              text: `Failed to select ${args.selector}: ${(error as Error).message}`,
            }],
          isError: true,
        };
      }
  • Input schema and definition for the browser_select tool, requiring 'selector' (CSS selector) and 'value' (option value).
    {
      name: ToolName.BrowserSelect,
      description: "Select an element on the page with Select tag using CSS selector",
      inputSchema: {
        type: "object",
        properties: {
          selector: { type: "string", description: "CSS selector for element to select" },
          value: { type: "string", description: "Value to select" },
        },
        required: ["selector", "value"],
      },
    },
  • index.ts:840-842 (registration)
    Registers the list of available tools, including browser_select, by returning the static TOOLS array in response to ListToolsRequest.
    server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: TOOLS,
    }));
  • index.ts:844-846 (registration)
    Registers the CallToolRequest handler which dispatches tool calls (including browser_select) to the handleToolCall function based on the tool name.
    server.setRequestHandler(CallToolRequestSchema, async (request) =>
      handleToolCall(request.params.name as ToolName, request.params.arguments ?? {})
    );
  • index.ts:28-28 (registration)
    Defines the tool name constant BrowserSelect = "browser_select" in the ToolName enum.
    BrowserSelect = "browser_select",
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions selecting an element but doesn't disclose behavioral traits like whether it requires the page to be loaded, if it waits for the element, what happens on failure, or if it triggers page changes. For a browser interaction tool with zero annotation coverage, this 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?

Single sentence, zero waste, front-loaded with the core action. Every word earns its place by specifying the element type and method, making it efficient and clear.

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?

For a browser interaction tool with no annotations and no output schema, the description is incomplete. It lacks details on behavior, error handling, return values, and differentiation from siblings. Given the complexity of browser automation and rich sibling set, more context is needed for 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). The description adds that it's for 'Select tag' elements, which gives context for the selector parameter, but doesn't provide additional syntax or format details beyond what the schema provides. Baseline 3 is appropriate when 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 element') and resource ('on the page with Select tag'), specifying it's for dropdown/select elements. It distinguishes from siblings like browser_click or browser_select_text by focusing on selecting options within select elements, though it doesn't explicitly name 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 on when to use this tool versus alternatives like browser_select_text or browser_click. The description implies usage for select elements but doesn't specify prerequisites, error conditions, or exclusions, leaving the agent to infer context from sibling names alone.

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/9olidity/MCP-Server-Pentest'

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