multi_browserbase_stagehand_session_list
List and monitor all active parallel browser sessions to manage automation workflows, verify session status, and obtain IDs for session-specific operations.
Instructions
ONLY WORKS WITH MULTI-SESSION TOOLS! Track all parallel sessions: Critical tool for multi-session management! Shows all active browser sessions with their IDs, names, ages, and Browserbase session IDs. Use this frequently to monitor your parallel automation workflows, verify sessions are running, and get session IDs for session-specific tools. Essential for debugging and resource management in complex multi-browser scenarios.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/multiSession.ts:157-198 (handler)The handler function that lists active browser sessions, including their IDs, names, Browserbase session IDs, creation times, and ages. Returns formatted text output for easy tracking in multi-session workflows.
handle: async (): Promise<ToolResult> => { const sessions = stagehandStore.list(); if (sessions.length === 0) { return { action: async () => ({ content: [ { type: "text", text: "No active sessions", }, ], }), waitForNetwork: false, }; } const sessionInfo = sessions.map((s) => ({ id: s.id, name: s.metadata?.name, browserbaseSessionId: s.metadata?.bbSessionId, created: new Date(s.created).toISOString(), age: Math.floor((Date.now() - s.created) / 1000), })); return { action: async () => ({ content: [ { type: "text", text: `Active sessions (${sessions.length}):\n${sessionInfo .map( (s) => `- ${s.id}${s.name ? ` (${s.name})` : ""} - BB: ${s.browserbaseSessionId} - Age: ${s.age}s`, ) .join("\n")}`, }, ], }), waitForNetwork: false, }; }, - src/tools/multiSession.ts:151-156 (schema)Schema definition for the tool, specifying name, detailed description emphasizing multi-session usage, and empty input schema since no parameters are required.
schema: { name: "multi_browserbase_stagehand_session_list", description: "ONLY WORKS WITH MULTI-SESSION TOOLS! Track all parallel sessions: Critical tool for multi-session management! Shows all active browser sessions with their IDs, names, ages, and Browserbase session IDs. Use this frequently to monitor your parallel automation workflows, verify sessions are running, and get session IDs for session-specific tools. Essential for debugging and resource management in complex multi-browser scenarios.", inputSchema: z.object({}), }, - src/tools/index.ts:26-34 (registration)Includes listSessionsTool in the multiSessionTools array, which is aggregated into the main TOOLS export for MCP server registration.
export const multiSessionTools = [ createSessionTool, listSessionsTool, closeSessionTool, navigateWithSessionTool, actWithSessionTool, extractWithSessionTool, observeWithSessionTool, ]; - src/tools/index.ts:37-45 (registration)Main TOOLS array export that includes all tools via multiSessionTools, used to register tools with the MCP server.
export const TOOLS = [ ...multiSessionTools, ...sessionTools, navigateTool, actTool, extractTool, observeTool, screenshotTool, ];