kiro_session_switch
Switch between different Kiro CLI sessions to manage isolated project contexts and workflows. Change active sessions using session IDs for organized development environments.
Instructions
Switch to a specific session
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | The session ID to switch to |
Implementation Reference
- src/kiro_cli_mcp/server.py:239-250 (handler)Primary handler function for kiro_session_switch tool call. Extracts session_id argument and calls SessionManager.switch_session, returning success confirmation.async def _handle_session_switch( session_manager: SessionManager, arguments: dict[str, Any] ) -> dict[str, Any]: """Handle kiro_session_switch tool call.""" session_id = arguments.get("session_id", "") await session_manager.switch_session(session_id) return { "success": True, "active_session_id": session_id, }
- src/kiro_cli_mcp/tools.py:55-68 (schema)Input schema definition for the kiro_session_switch tool in the TOOLS list used for tool discovery.{ "name": "kiro_session_switch", "description": "Switch to a specific session", "inputSchema": { "type": "object", "properties": { "session_id": { "type": "string", "description": "The session ID to switch to" } }, "required": ["session_id"] } },
- src/kiro_cli_mcp/server.py:102-103 (registration)Registration/dispatch point in the main call_tool handler that routes 'kiro_session_switch' calls to the specific handler.elif name == "kiro_session_switch": result = await _handle_session_switch(session_manager, arguments)
- src/kiro_cli_mcp/session.py:393-409 (helper)Supporting utility method in SessionManager class that implements the core session switching logic by updating the active_session_id.async def switch_session(self, session_id: str) -> Session: """Switch to a specific session. Args: session_id: The session ID to switch to Returns: The switched-to Session Raises: SessionError: If session not found """ session = await self.get_session(session_id) self.active_session_id = session_id session.update_activity() return session