safari_list_sessions
Retrieve all active Safari browser sessions using this tool to monitor and manage ongoing browser activities, enabling efficient debugging and automation.
Instructions
List all active Safari sessions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/safari-mcp-server.ts:403-412 (handler)The primary handler function for 'safari_list_sessions' tool. It fetches active sessions from the driver manager and returns a formatted text response listing them.private async listSessions(): Promise<Array<{ type: string; text: string }>> { const sessions = this.driverManager.getAllSessions(); return [ { type: 'text', text: `Active Safari Sessions (${sessions.length}):\n${sessions.join('\n')}` } ]; }
- src/safari-mcp-server.ts:201-204 (schema)Input schema definition for the tool, specifying an empty object (no required parameters).inputSchema: { type: 'object', properties: {} }
- src/safari-mcp-server.ts:258-259 (registration)Tool handler registration in the switch statement of the central handleToolCall method.case 'safari_list_sessions': return await this.listSessions();
- src/safari-driver.ts:442-444 (helper)Helper method in SafariDriverManager that retrieves all active session IDs from the internal sessions map.getAllSessions(): string[] { return Array.from(this.sessions.keys()); }