kiro_session_save
Save current Kiro CLI session to a file for later restoration, enabling persistent workflow management across development sessions.
Instructions
Save current kiro-cli session to a file using /save command
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Optional MCP session ID | |
| path | Yes | Path to save session (relative to working directory) |
Implementation Reference
- src/kiro_cli_mcp/server.py:441-469 (handler)Main handler function that executes the /save command in the kiro-cli session to save it to the specified path.async def _handle_session_save( session_manager: SessionManager, command_executor: CommandExecutor, arguments: dict[str, Any] ) -> dict[str, Any]: """Handle kiro_session_save tool call - save session using /save command.""" session_id = arguments.get("session_id") save_path = arguments.get("path", "") if not save_path: return { "success": False, "error": "Path is required", } session = await session_manager.get_or_create_session(session_id) # Execute /save command result = await command_executor.execute_command( session, f"/save {save_path}" ) return { **result.to_dict(), "session_id": session.id, "save_path": save_path, }
- src/kiro_cli_mcp/tools.py:230-247 (schema)Input schema definition for the kiro_session_save tool, defining parameters session_id (optional) and path (required).{ "name": "kiro_session_save", "description": "Save current kiro-cli session to a file using /save command", "inputSchema": { "type": "object", "properties": { "session_id": { "type": "string", "description": "Optional MCP session ID" }, "path": { "type": "string", "description": "Path to save session (relative to working directory)" } }, "required": ["path"] } }
- src/kiro_cli_mcp/server.py:129-132 (registration)Registration of the kiro_session_save handler in the main tool dispatch function handle_call_tool.elif name == "kiro_session_save": result = await _handle_session_save( session_manager, command_executor, arguments )
- src/kiro_cli_mcp/server.py:67-78 (registration)Tool listing handler that registers all tools including kiro_session_save via get_all_tools() from tools.py.@server.list_tools() async def handle_list_tools() -> list[Tool]: """List available tools.""" tools_data = get_all_tools() return [ Tool( name=tool["name"], description=tool["description"], inputSchema=tool["inputSchema"] ) for tool in tools_data ]