browser_select_option
Select a specific option from a dropdown element within a browser instance on the Concurrent Browser MCP server. Specify element selector, value, and optional timeout for efficient automation.
Instructions
Select an option from a dropdown
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | Yes | Instance ID | |
| selector | Yes | Element selector | |
| timeout | No | Timeout in milliseconds | |
| value | Yes | Value to select |
Implementation Reference
- src/tools.ts:769-789 (handler)The handler function that implements the core logic for the browser_select_option tool. It retrieves the browser instance, locates the dropdown element using the selector, selects the specified option value, and returns success or error status.private async selectOption(instanceId: string, selector: string, value: string, timeout: number): Promise<ToolResult> { const instance = this.browserManager.getInstance(instanceId); if (!instance) { return { success: false, error: `Instance ${instanceId} not found` }; } try { await instance.page.selectOption(selector, value, { timeout }); return { success: true, data: { selector, value, selected: true }, instanceId }; } catch (error) { return { success: false, error: `Select option failed: ${error instanceof Error ? error.message : error}`, instanceId }; } }
- src/tools.ts:264-290 (registration)The registration of the browser_select_option tool in the getTools() method, defining its name, description, and input schema.{ name: 'browser_select_option', description: 'Select an option from a dropdown', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' }, selector: { type: 'string', description: 'Element selector', }, value: { type: 'string', description: 'Value to select', }, timeout: { type: 'number', description: 'Timeout in milliseconds', default: 30000 } }, required: ['instanceId', 'selector', 'value'] } },
- src/tools.ts:267-289 (schema)The input schema defining the parameters for the browser_select_option tool: instanceId, selector, value, and optional timeout.inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' }, selector: { type: 'string', description: 'Element selector', }, value: { type: 'string', description: 'Value to select', }, timeout: { type: 'number', description: 'Timeout in milliseconds', default: 30000 } }, required: ['instanceId', 'selector', 'value'] }