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
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | CSS selector for the select element | |
| value | Yes | Value to select |
Implementation Reference
- tools-playwright.js:104-119 (handler)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}` }; } },
- tools-playwright.js:107-114 (schema)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.js:94-97 (helper)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);