Skip to main content
Glama
NovaAI-innovation

CSV MCP Server

delete_csv

Remove CSV files from your filesystem with optional backup functionality to prevent data loss during deletion operations.

Instructions

Delete a CSV file (with backup if enabled).

Args:
    filename: Name of the CSV file to delete

Returns:
    Dictionary with deletion results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for delete_csv. Decorated with @mcp.tool() which registers the tool. Delegates execution to csv_manager.delete_csv with error handling.
    @mcp.tool()
    def delete_csv(filename: str) -> Dict[str, Any]:
        """
        Delete a CSV file (with backup if enabled).
        
        Args:
            filename: Name of the CSV file to delete
        
        Returns:
            Dictionary with deletion results
        """
        try:
            return csv_manager.delete_csv(filename)
        except Exception as e:
            return {"success": False, "error": str(e)}
  • Core deletion logic in CSVManager class. Handles file path resolution, backup creation, file deletion, logging, and returns detailed success/error information.
    def delete_csv(self, filename: str) -> Dict[str, Any]:
        """Delete a CSV file."""
        filepath = self._get_file_path(filename)
        
        if not filepath.exists():
            raise FileNotFoundError(f"CSV file '{filename}' not found")
        
        try:
            # Create backup before deletion
            backup_path = self._create_backup(filepath)
            
            # Delete the file
            filepath.unlink()
            
            logger.info(f"Deleted CSV file: {filepath}")
            return {
                "success": True,
                "filename": filename,
                "deleted_filepath": str(filepath),
                "backup_created": backup_path is not None,
                "backup_path": str(backup_path) if backup_path else None
            }
        except Exception as e:
            logger.error(f"Failed to delete CSV: {e}")
            raise
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the backup behavior ('with backup if enabled'), which is valuable context beyond basic deletion. However, it lacks details on permissions needed, whether deletion is reversible, error handling, or rate limits, leaving behavioral gaps for a destructive operation.

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

Conciseness4/5

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

The description is front-loaded with the core action and includes structured sections for Args and Returns, making it efficient. However, the backup note could be integrated more seamlessly, and the Returns section is vague ('Dictionary with deletion results'), slightly reducing clarity.

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 no annotations and an output schema (which handles return values), the description is moderately complete. It covers the main action and backup behavior but misses critical context for a destructive tool, such as safety warnings, confirmation steps, or dependencies on other tools (e.g., 'list_csv_files' to verify existence).

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

Parameters3/5

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

Schema description coverage is 0%, but the description adds minimal semantics by specifying 'Name of the CSV file to delete' for the 'filename' parameter. This clarifies the parameter's role, though it doesn't provide format details (e.g., file extensions, paths) or examples, resulting in adequate but incomplete compensation.

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

Purpose5/5

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

The description clearly states the verb 'Delete' and resource 'CSV file', making the purpose specific and unambiguous. It distinguishes from siblings like 'remove_row' (row-level operation) and 'update_csv' (modification rather than deletion).

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?

No explicit guidance on when to use this tool versus alternatives like 'remove_row' (for row deletion) or other file management tools. The mention of 'backup if enabled' hints at a configuration context but doesn't provide clear when/when-not rules or prerequisites for usage.

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/NovaAI-innovation/csv-mcp-server'

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