Skip to main content
Glama

select

Choose an option from dropdown menus on web pages using CSS selectors to automate form interactions during browser automation tasks.

Instructions

Select an option from a dropdown

Input Schema

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

Implementation Reference

  • MCP tool definition for 'select', including input schema, description, and handler function that invokes the browser's select method to choose a dropdown option.
    { 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'] }, handler: async ({ selector, value }) => { await browser.select(selector, value); return { success: true, message: `Selected "${value}" in ${selector}` }; } },
  • Input schema defining parameters for the 'select' tool: CSS selector for the dropdown and the value to select.
    inputSchema: { type: 'object', properties: { selector: { type: 'string', description: 'CSS selector for the select element' }, value: { type: 'string', description: 'Value to select' } }, required: ['selector', 'value'] },
  • Browser wrapper's select method implementation using Playwright's page.selectOption to perform the actual dropdown selection.
    async select(selector, value) { await this.ensureLaunched(); await this.page.selectOption(selector, value); }
  • index.js:75-76 (registration)
    Creation of all tools array (including 'select') via createTools, used for MCP server tool listing and execution handling.
    const tools = createTools(browser);

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/zypin-testing/zypin-mcp'

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