browser_close_instance
Close a specific browser instance by its Instance ID on the Concurrent Browser MCP server, enabling efficient management of multiple parallel browser sessions.
Instructions
Close the specified browser instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | Yes | Instance ID |
Implementation Reference
- src/tools.ts:69-82 (schema)Defines the input schema for the 'browser_close_instance' tool, requiring an 'instanceId' string parameter.{ name: 'browser_close_instance', description: 'Close the specified browser instance', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' } }, required: ['instanceId'] } },
- src/tools.ts:512-513 (handler)Handler case in BrowserTools.executeTools method that invokes BrowserManager.closeInstance for the tool execution.case 'browser_close_instance': return await this.browserManager.closeInstance(args.instanceId);
- src/browser-manager.ts:266-290 (helper)Core helper method in BrowserManager that closes the specified browser instance by closing the browser object and removing it from the internal instances map.async closeInstance(instanceId: string): Promise<ToolResult> { try { const instance = this.instances.get(instanceId); if (!instance) { return { success: false, error: `Instance ${instanceId} not found` }; } await instance.browser.close(); this.instances.delete(instanceId); return { success: true, data: { instanceId, closed: true }, instanceId }; } catch (error) { return { success: false, error: `Failed to close instance: ${error instanceof Error ? error.message : error}` }; } }