browser_close_all_instances
Close all open browser instances to free system resources and ensure clean browser state for testing or automation workflows.
Instructions
Close all browser instances
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/browser-manager.ts:295-315 (handler)Core handler method in BrowserManager that closes all active browser instances by awaiting the close promises for each browser and clearing the instances map.async closeAllInstances(): Promise<ToolResult> { try { const closePromises = Array.from(this.instances.values()).map( instance => instance.browser.close() ); await Promise.all(closePromises); const closedCount = this.instances.size; this.instances.clear(); return { success: true, data: { closedCount } }; } catch (error) { return { success: false, error: `Failed to close all instances: ${error instanceof Error ? error.message : error}` }; } }
- src/tools.ts:515-516 (handler)Dispatch handler in BrowserTools.executeTools() that delegates to BrowserManager.closeAllInstances().case 'browser_close_all_instances': return await this.browserManager.closeAllInstances();
- src/tools.ts:83-90 (registration)Tool registration in BrowserTools.getTools(), defining the tool name, description, and empty input schema.{ name: 'browser_close_all_instances', description: 'Close all browser instances', inputSchema: { type: 'object', properties: {} } },
- src/tools.ts:86-89 (schema)Input schema definition for the tool (empty object properties).inputSchema: { type: 'object', properties: {} }