browser_close_instance
Close a specific browser instance to manage resources and end sessions in the Concurrent Browser MCP server.
Instructions
Close the specified browser instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| instanceId | Yes | Instance ID |
Implementation Reference
- src/tools.ts:512-513 (handler)Handler case in executeTools method that handles the browser_close_instance tool by calling BrowserManager.closeInstancecase 'browser_close_instance': return await this.browserManager.closeInstance(args.instanceId);
- src/tools.ts:69-82 (registration)Tool registration in getTools() method, defining name, description, and input schema{ name: 'browser_close_instance', description: 'Close the specified browser instance', inputSchema: { type: 'object', properties: { instanceId: { type: 'string', description: 'Instance ID' } }, required: ['instanceId'] } },
- src/browser-manager.ts:266-290 (helper)Core implementation in BrowserManager that closes the Playwright browser instance and removes it from the instances mapasync 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}` }; } }