Skip to main content
Glama

pilot_select_option

Select an option from a dropdown, combobox, or list by matching value, label, or visible text. Returns confirmation of the selected value and element ref.

Instructions

Select an option from a dropdown element by value, label, or visible text. Use when the user wants to choose a dropdown option, select from a combobox, or pick from a list. Note: clicking an in pilot_snapshot is auto-routed here.

Parameters:

  • ref: The element reference from snapshot (e.g., "@e5") or a CSS selector

  • value: The option's value attribute, label, or visible text to match

Returns: Confirmation with the selected value and element ref.

Errors:

  • "No option matched": The value does not match any option. Check the exact option text or value attribute via pilot_page_html.

  • "Element not found": The ref is stale or does not point to a element. Run pilot_snapshot.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesSelect element ref (@e3) or CSS selector
valueYesOption value, label, or text to select

Implementation Reference

  • The main handler for the 'pilot_select_option' tool. Registered via server.tool() inside registerInteractionTools(). It takes a 'ref' (select element) and 'value' (option value/label/text), supports both extension and Playwright modes, resolves the ref, and calls selectOption(). On success returns a confirmation with snapshot; on failure returns an error message.
      server.tool(
        'pilot_select_option',
        `Select an option from a <select> dropdown element by value, label, or visible text.
    Use when the user wants to choose a dropdown option, select from a combobox, or pick from a list. Note: clicking an <option> in pilot_snapshot is auto-routed here.
    
    Parameters:
    - ref: The <select> element reference from snapshot (e.g., "@e5") or a CSS selector
    - value: The option's value attribute, label, or visible text to match
    
    Returns: Confirmation with the selected value and element ref.
    
    Errors:
    - "No option matched": The value does not match any option. Check the exact option text or value attribute via pilot_page_html.
    - "Element not found": The ref is stale or does not point to a <select> element. Run pilot_snapshot.`,
          {
          ref: z.string().describe('Select element ref (@e3) or CSS selector'),
          value: z.string().describe('Option value, label, or text to select'),
        },
        async ({ ref, value }) => {
          await bm.ensureBrowser();
          try {
            const ext = bm.getExtension();
            if (ext) {
              const res = await ext.send<{ selected: string; value: string }>('select_option', { ref, label: value });
              bm.resetFailures();
              return { content: [{ type: 'text' as const, text: `Selected "${res.selected}" in ${ref}` }] };
            }
            const resolved = await bm.resolveRef(ref);
            if ('locator' in resolved) {
              await resolved.locator.selectOption(value, { timeout: 5000 });
            } else {
              await bm.getPage().selectOption(resolved.selector, value, { timeout: 5000 });
            }
            bm.resetFailures();
            const snap = await postActionSnapshot(bm);
            return { content: [{ type: 'text' as const, text: `Selected "${value}" in ${ref}${snap}` }] };
          } catch (err) {
            bm.incrementFailures();
            return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
          }
        }
      );
  • Zod input schema for pilot_select_option. Validates two parameters: 'ref' (string, element ref or CSS selector) and 'value' (string, option value/label/text to select).
      {
      ref: z.string().describe('Select element ref (@e3) or CSS selector'),
      value: z.string().describe('Option value, label, or text to select'),
    },
  • Registration entry point: registerAllTools() calls registerInteractionTools() which registers the pilot_select_option tool. Also listed in the STANDARD_TOOLS set (line 41) for profile-based filtering.
    export function registerAllTools(server: McpServer, bm: BrowserManager, profile: ToolProfile = 'full'): void {
      const allowed = PROFILE_TOOLS[profile];
      const effectiveServer = allowed ? createFilteredServer(server, allowed) : server;
    
      registerNavigationTools(effectiveServer, bm);
      registerSnapshotTools(effectiveServer, bm);
      registerInteractionTools(effectiveServer, bm);
      registerPageTools(effectiveServer, bm);
      registerInspectionTools(effectiveServer, bm);
      registerVisualTools(effectiveServer, bm);
      registerTabTools(effectiveServer, bm);
      registerSettingsTools(effectiveServer, bm);
      registerIframeTools(effectiveServer, bm);
      registerAutomationTools(effectiveServer, bm);
    }
  • 'pilot_select_option' is listed in the STANDARD_TOOLS set (line 41), meaning it's included in the 'standard' tool profile but not in the 'core' profile.
    'pilot_hover', 'pilot_select_option', 'pilot_scroll', 'pilot_drag',
  • The postActionSnapshot helper function used by pilot_select_option to capture a lightweight interactive snapshot after selecting an option.
    /** After an action, take a lightweight snapshot so the LLM doesn't need a separate call */
    async function postActionSnapshot(bm: BrowserManager): Promise<string> {
      try {
        const snap = await takeSnapshot(bm, { interactive: true, maxElements: 20, lean: true });
        return '\n--- page state (interactive, top 20) ---\n' + snap;
      } catch {
        return '';
      }
    }
Behavior4/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 describes the selection action, returns confirmation, and lists errors. However, it does not disclose whether change events are triggered or if there are side effects, which would be beneficial for a complete behavioral picture.

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 concise and well-structured: purpose, usage, parameter details, return value, and errors. Every sentence contributes meaning without unnecessary wordiness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is complete for a simple tool with two parameters. It covers return confirmation and two common error conditions, which compensates for the lack of an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema covers all parameters with descriptions. The description adds extra context: 'Select element ref (@e3) or CSS selector' and 'Option value, label, or text to select', providing more detail than the schema alone. Given 100% schema coverage, the description adds marginal value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool selects an option from a <select> dropdown by value, label, or visible text. It distinguishes from clicking by noting that clicking an <option> in pilot_snapshot is auto-routed here.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: 'Use when the user wants to choose a dropdown option, select from a combobox, or pick from a list.' It also mentions auto-routing from pilot_snapshot. However, it does not explicitly state when not to use this tool versus alternatives like pilot_click.

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/TacosyHorchata/Pilot'

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