get_auto_save_status
Check if auto-save is active for a CSV editing session to prevent data loss during large file processing.
Instructions
Get auto-save status for a session.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes |
Implementation Reference
- Main handler function that retrieves the auto-save status for a given session by fetching the session and calling its get_auto_save_status method, then wrapping the result in OperationResult.async def get_auto_save_status( session_id: str, ctx: Context = None ) -> Dict[str, Any]: """ Get auto-save status for a session. Args: session_id: Session identifier ctx: FastMCP context Returns: Dict with auto-save status """ try: manager = get_session_manager() session = manager.get_session(session_id) if not session: return OperationResult( success=False, message="Session not found", error=f"No session with ID: {session_id}" ).model_dump() status = session.get_auto_save_status() if ctx: await ctx.info(f"Auto-save status retrieved for session {session_id}") return OperationResult( success=True, message="Auto-save status retrieved", session_id=session_id, data=status ).model_dump() except Exception as e: logger.error(f"Error getting auto-save status: {str(e)}") if ctx: await ctx.error(f"Failed to get auto-save status: {str(e)}") return OperationResult( success=False, message="Failed to get auto-save status", error=str(e) ).model_dump()
- src/csv_editor/server.py:470-477 (registration)MCP tool registration using @mcp.tool decorator. This is the entry point for the tool, which delegates to the implementation in auto_save_operations.py.@mcp.tool async def get_auto_save_status( session_id: str, ctx: Context = None ) -> Dict[str, Any]: """Get auto-save status for a session.""" return await _get_auto_save_status(session_id, ctx)
- Helper method on CSVSession model that returns the auto-save status from the AutoSaveManager instance.def get_auto_save_status(self) -> Dict[str, Any]: """Get current auto-save status.""" return self.auto_save_manager.get_status()