Skip to main content
Glama
nfodor

Chromium ARM64 Browser

by nfodor

select

Choose an option from dropdown menus on web pages using CSS selectors to automate form filling and testing workflows in browser automation.

Instructions

Select an option from a dropdown

Input Schema

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

Implementation Reference

  • The handler function for the 'select' tool. It uses CDP Runtime.evaluate to execute JavaScript that finds the select element by CSS selector, sets its value, dispatches a change event, and returns success or throws if not found.
    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 definition in the listTools response, including name, description, and input schema requiring 'selector' (string) and 'value' (string).
    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)
    Registration of the 'select' tool handler within the switch statement of the CallToolRequestSchema request 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/mcp-chromium-arm64'

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