Skip to main content
Glama

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
NameRequiredDescriptionDefault
session_idYesThe session ID to switch to

Implementation Reference

  • 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,
        }
  • 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"]
        }
    },
  • 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)
  • 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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vanphappi/kiro-cli-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server