Skip to main content
Glama
andytango
by andytango

select

Select options from dropdown or select elements on web pages using CSS selectors and specified values for browser automation tasks.

Instructions

Select option(s) from a dropdown/select element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector for the element
valuesYesOption values to select
timeoutNoTimeout in milliseconds
tabIdNoTab ID to operate on (uses active tab if not specified)

Implementation Reference

  • Handler for the 'select' tool: waits for the selector, then uses page.select to choose the specified option values from a dropdown.
    // Select dropdown option
    server.tool('select', 'Select option(s) from a dropdown/select element', selectSchema.shape, async ({ selector, values, timeout, tabId }) => {
        const pageResult = await getPageForOperation(tabId);
        if (!pageResult.success) {
            return handleResult(pageResult);
        }
        const page = pageResult.data;
        const timeoutMs = timeout ?? getDefaultTimeout();
        try {
            await page.waitForSelector(selector, { timeout: timeoutMs });
            const selected = await page.select(selector, ...values);
            return handleResult(ok({ selected, selector }));
        }
        catch (error) {
            if (error instanceof Error && error.message.includes('waiting for selector')) {
                return handleResult(err(selectorNotFound(selector)));
            }
            return handleResult(err(normalizeError(error)));
        }
    });
  • Input schema for the 'select' tool using Zod, defining selector, values (array of strings), optional timeout and tabId.
    export const selectSchema = z.object({
        selector: selectorSchema,
        values: z.array(z.string()).min(1).describe('Option values to select'),
        timeout: timeoutSchema,
        tabId: tabIdSchema,
    });
  • dist/server.js:22-22 (registration)
    Registers the interaction tools group, which includes the 'select' tool.
    registerInteractionTools(server);
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions the action but doesn't disclose whether this requires the element to be in a particular state (visible, enabled), what happens with invalid selectors/values, or if it waits for page updates. This leaves significant gaps for a mutation tool interacting with web elements.

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 that directly states the tool's purpose without unnecessary words. It's appropriately sized for a straightforward tool and front-loads the essential information, making it easy 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?

For a tool with 4 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain return values, error conditions, or behavioral nuances (like multi-select support implied by 'option(s)'). Given the complexity of web automation and lack of structured data, more context is needed for reliable 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%, providing complete parameter documentation. The description adds no additional parameter semantics beyond what's in the schema (e.g., explaining what 'values' represents or selector syntax). This meets the baseline for high schema coverage but doesn't enhance understanding.

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 option(s)') and target ('from a dropdown/select element'), providing a specific verb+resource combination. However, it doesn't explicitly distinguish this tool from similar siblings like 'click' or 'fill' that might also interact with form elements, which prevents a perfect score.

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 like 'click' for buttons or 'fill' for text inputs. It doesn't mention prerequisites (e.g., needing the element to be visible) or exclusions (e.g., not working on non-select elements), leaving the agent with minimal context for tool selection.

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/andytango/puppeteer-mcp'

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