browser_fill
Fill specified form fields in browser instances by providing an element selector and value. Part of the Concurrent Browser MCP server for managing multiple parallel browser sessions.
Instructions
Fill a form field
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 fill |
Implementation Reference
- src/tools.ts:747-767 (handler)The main handler function for the 'browser_fill' tool. It retrieves the browser instance, locates the element by selector, fills it with the provided value using Playwright's page.fill method, and returns success or error status.private async fill(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.fill(selector, value, { timeout }); return { success: true, data: { selector, value, filled: true }, instanceId }; } catch (error) { return { success: false, error: `Fill failed: ${error instanceof Error ? error.message : error}`, instanceId }; } }
- src/tools.ts:237-263 (schema)The input schema definition for the 'browser_fill' tool, specifying required parameters: instanceId, selector, value, and optional timeout.{ name: 'browser_fill', description: 'Fill a form field', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' }, selector: { type: 'string', description: 'Element selector', }, value: { type: 'string', description: 'Value to fill', }, timeout: { type: 'number', description: 'Timeout in milliseconds', default: 30000 } }, required: ['instanceId', 'selector', 'value'] } },
- src/tools.ts:547-548 (registration)The switch case in executeTools method that registers and dispatches the 'browser_fill' tool call to the fill handler method.case 'browser_fill': return await this.fill(args.instanceId, args.selector, args.value, args.timeout || 30000);