Skip to main content
Glama
santoshray02

CSV Editor

by santoshray02

configure_auto_save

Set up automatic saving for CSV editing sessions to prevent data loss by configuring backup frequency, location, and file format.

Instructions

Configure auto-save settings for a session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
enabledNo
modeNoafter_operation
strategyNobackup
interval_secondsNo
max_backupsNo
backup_dirNo
custom_pathNo
formatNocsv
encodingNoutf-8

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core implementation of the configure_auto_save tool handler. This function configures auto-save settings for a CSV session by building a config dict and calling session.enable_auto_save().
    async def configure_auto_save(
        session_id: str,
        enabled: bool = True,
        mode: str = "after_operation",
        strategy: str = "backup",
        interval_seconds: Optional[int] = None,
        max_backups: Optional[int] = None,
        backup_dir: Optional[str] = None,
        custom_path: Optional[str] = None,
        format: str = "csv",
        encoding: str = "utf-8",
        ctx: Context = None
    ) -> Dict[str, Any]:
        """
        Configure auto-save settings for a session.
        
        Args:
            session_id: Session identifier
            enabled: Whether auto-save is enabled
            mode: Auto-save mode ('disabled', 'after_operation', 'periodic', 'hybrid')
            strategy: Save strategy ('overwrite', 'backup', 'versioned', 'custom')
            interval_seconds: Interval for periodic saves (default 300)
            max_backups: Maximum number of backup files to keep (default 10)
            backup_dir: Directory for backup files
            custom_path: Custom path for saves (when strategy='custom')
            format: Export format ('csv', 'tsv', 'json', 'excel', 'parquet')
            encoding: File encoding (default 'utf-8')
            ctx: FastMCP context
            
        Returns:
            Dict with success status and configuration
        """
        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()
            
            if ctx:
                await ctx.info(f"Configuring auto-save for session {session_id}")
            
            # Build configuration
            config = {
                "enabled": enabled,
                "mode": mode,
                "strategy": strategy,
                "format": format,
                "encoding": encoding
            }
            
            if interval_seconds is not None:
                config["interval_seconds"] = interval_seconds
            if max_backups is not None:
                config["max_backups"] = max_backups
            if backup_dir is not None:
                config["backup_dir"] = backup_dir
            if custom_path is not None:
                config["custom_path"] = custom_path
            
            # Apply configuration
            result = await session.enable_auto_save(config)
            
            if result["success"]:
                if ctx:
                    await ctx.info(f"Auto-save configured: {mode} mode, {strategy} strategy")
                
                return OperationResult(
                    success=True,
                    message=f"Auto-save configured successfully",
                    session_id=session_id,
                    data=result["config"]
                ).model_dump()
            else:
                return OperationResult(
                    success=False,
                    message="Failed to configure auto-save",
                    error=result.get("error")
                ).model_dump()
                
        except Exception as e:
            logger.error(f"Error configuring auto-save: {str(e)}")
            if ctx:
                await ctx.error(f"Failed to configure auto-save: {str(e)}")
            return OperationResult(
                success=False,
                message="Failed to configure auto-save",
                error=str(e)
            ).model_dump()
  • Tool registration for configure_auto_save using @mcp.tool decorator in the main server.py file. Imports the handler from auto_save_operations.py and provides a thin wrapper.
    from .tools.auto_save_operations import (
        configure_auto_save as _configure_auto_save,
        disable_auto_save as _disable_auto_save,
        get_auto_save_status as _get_auto_save_status,
        trigger_manual_save as _trigger_manual_save
    )
    
    @mcp.tool
    async def configure_auto_save(
        session_id: str,
        enabled: bool = True,
        mode: str = "after_operation",
        strategy: str = "backup",
        interval_seconds: Optional[int] = None,
        max_backups: Optional[int] = None,
        backup_dir: Optional[str] = None,
        custom_path: Optional[str] = None,
        format: str = "csv",
        encoding: str = "utf-8",
        ctx: Context = None
    ) -> Dict[str, Any]:
        """Configure auto-save settings for a session."""
        return await _configure_auto_save(
            session_id, enabled, mode, strategy, interval_seconds,
            max_backups, backup_dir, custom_path, format, encoding, ctx
        )
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool configures settings but doesn't reveal whether this is a mutation (likely yes), what permissions are required, whether changes are reversible, or how the configuration affects session behavior. For a tool with 10 parameters and no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for what it conveys. Every word earns its place, though it could benefit from additional context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (10 parameters, no annotations, but has an output schema), the description is minimally adequate. The output schema reduces the need to explain return values, but the description lacks crucial context about parameter meanings, behavioral effects, and usage guidelines. It meets the bare minimum for a configuration tool but leaves significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning none of the 10 parameters have descriptions in the schema. The tool description doesn't mention any parameters, their purposes, or how they interact (e.g., that 'interval_seconds' might only apply to certain modes). This leaves the agent to guess parameter meanings from names alone, which is inadequate given the complexity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('configure') and resource ('auto-save settings for a session'), making the purpose unambiguous. It distinguishes from sibling tools like 'disable_auto_save' and 'get_auto_save_status' by focusing on configuration rather than disabling or querying status. However, it doesn't specify what aspects of auto-save are configurable, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active session), exclusions, or comparisons to sibling tools like 'disable_auto_save' or 'trigger_manual_save'. The agent must infer usage from the tool name and context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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