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
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "browser_close_all_instances"
}
}Input 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: {} }