Skip to main content
Glama
santoshray02

CSV Editor

by santoshray02

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
NameRequiredDescriptionDefault
session_idYes

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()
  • 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()

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/santoshray02/csv-editor'

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