browser_list_instances
Lists all active browser instances to manage multiple parallel browsing sessions in the Concurrent Browser MCP server.
Instructions
List all browser instances
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:61-68 (schema)Defines the tool schema for 'browser_list_instances', including name, description, and empty input schema (no parameters required).{ name: 'browser_list_instances', description: 'List all browser instances', inputSchema: { type: 'object', properties: {} } },
- src/tools.ts:509-510 (handler)Handler case in executeTools method that executes the tool by calling BrowserManager.listInstances().case 'browser_list_instances': return this.browserManager.listInstances();
- src/browser-manager.ts:243-261 (handler)Core implementation of listing all browser instances, mapping instance data and returning structured ToolResult.listInstances(): ToolResult { const instanceList = Array.from(this.instances.values()).map(instance => ({ id: instance.id, isActive: instance.isActive, createdAt: instance.createdAt.toISOString(), lastUsed: instance.lastUsed.toISOString(), metadata: instance.metadata, currentUrl: instance.page.url() })); return { success: true, data: { instances: instanceList, totalCount: this.instances.size, maxInstances: this.config.maxInstances } }; }
- src/server.ts:40-45 (registration)Registers the MCP listTools handler which returns all tools including 'browser_list_instances' via BrowserTools.getTools().this.server.setRequestHandler(ListToolsRequestSchema, async () => { const tools = this.browserTools.getTools(); return { tools: tools, }; });
- src/server.ts:48-75 (registration)Registers the MCP callTool handler which dispatches to BrowserTools.executeTools for executing 'browser_list_instances' and other tools.this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await this.browserTools.executeTools(name, args || {}); if (result.success) { return { content: [ { type: 'text', text: JSON.stringify(result.data, null, 2), }, ], }; } else { throw new McpError(ErrorCode.InternalError, result.error || 'Tool execution failed'); } } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError( ErrorCode.InternalError, `Tool execution failed: ${error instanceof Error ? error.message : error}` ); } });