Skip to main content
Glama

select

Use the 'select' tool in the chromium-arm64 MCP server to choose an option from a dropdown on a webpage by specifying the element's CSS selector and desired value for browser automation and testing.

Instructions

Select an option from a dropdown

Input Schema

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

Implementation Reference

  • The main handler function for the 'select' tool. It uses CDP to evaluate JavaScript that finds the select element by CSS selector, sets its value, and dispatches a change event.
    async select(selector, value) { await this.ensureChromium(); const result = await this.sendCDPCommand('Runtime.evaluate', { expression: ` const select = document.querySelector('${selector}'); if (select) { select.value = '${value}'; select.dispatchEvent(new Event('change', { bubbles: true })); true; } else { false; } `, returnByValue: true }); if (!result.result?.value) { throw new Error(`Select element not found: ${selector}`); } return { content: [{ type: 'text', text: `Selected '${value}' in ${selector}` }], }; }
  • The tool schema and registration definition, including name, description, and input schema specifying 'selector' and 'value' parameters.
    { name: 'select', description: 'Select an option from a dropdown', inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the select element', }, value: { type: 'string', description: 'Value to select', }, }, required: ['selector', 'value'], },
  • index.js:366-366 (registration)
    The dispatch case in the CallToolRequestSchema handler that routes calls to the select tool handler.
    return await this.select(args.selector, args.value);

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/nfodor/claude-arm64-browser'

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