Skip to main content
Glama
NovaAI-innovation

CSV MCP Server

list_csv_files

Discover and access CSV files stored in your directory with metadata details for data management workflows.

Instructions

List all CSV files in the storage directory.

Returns:
    Dictionary with list of CSV files and their metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler decorated with @mcp.tool() that handles the list_csv_files tool call by delegating to the CSVManager instance.
    @mcp.tool()
    def list_csv_files() -> Dict[str, Any]:
        """
        List all CSV files in the storage directory.
        
        Returns:
            Dictionary with list of CSV files and their metadata
        """
        try:
            return csv_manager.list_csv_files()
        except Exception as e:
            return {"success": False, "error": str(e)}
  • Core helper method in CSVManager class that implements the logic to list all CSV files in the storage directory using glob, collects metadata, and returns structured results.
    def list_csv_files(self) -> Dict[str, Any]:
        """List all CSV files in the storage directory."""
        try:
            csv_files = []
            for filepath in self.storage_path.glob("*.csv"):
                if filepath.is_file():
                    stat = filepath.stat()
                    csv_files.append({
                        "filename": filepath.name,
                        "size_bytes": stat.st_size,
                        "size_mb": round(stat.st_size / (1024 * 1024), 2),
                        "modified_time": datetime.fromtimestamp(stat.st_mtime).isoformat()
                    })
            
            return {
                "success": True,
                "csv_files": csv_files,
                "total_files": len(csv_files),
                "storage_path": str(self.storage_path)
            }
        except Exception as e:
            logger.error(f"Failed to list CSV files: {e}")
            raise
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the return type ('Dictionary with list of CSV files and their metadata'), which adds some behavioral context. However, it lacks details on permissions, rate limits, error handling, or whether this is a read-only operation, which are important for a tool that interacts with storage.

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 purpose in the first sentence, followed by return information. It is brief and avoids unnecessary words, though the structure could be slightly improved by integrating the return details more seamlessly or using bullet points for better readability.

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 that there is an output schema (which should detail the return structure), the description need not explain return values extensively. However, for a tool with no annotations and multiple siblings, it lacks context on prerequisites, error cases, or how it fits into the broader workflow, making it minimally adequate but with clear gaps.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description correctly omits parameter details, focusing on the tool's action and output. This is efficient and appropriate, though not perfect as it could briefly note the lack of parameters for clarity.

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 ('List') and resource ('CSV files in the storage directory'), making the purpose immediately understandable. However, it does not explicitly differentiate this tool from sibling tools like 'read_csv' or 'get_path_info', which might also involve CSV file operations, so it falls short of 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. With siblings like 'read_csv' (which might read file contents) and 'get_path_info' (which might retrieve metadata), there is no indication of when listing files is preferred over other operations, leaving usage context unclear.

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