Skip to main content
Glama
NovaAI-innovation

CSV MCP Server

get_info

Retrieve metadata and structure details for CSV files to understand data organization and format before processing or analysis.

Instructions

Get basic information about a CSV file.

Args:
    filename: Name of the CSV file

Returns:
    Dictionary with file metadata and structure information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'get_info' decorated with @mcp.tool(). Delegates to csv_manager.get_info and handles errors. Includes input/output schema via type hints and docstring.
    @mcp.tool()
    def get_info(filename: str) -> Dict[str, Any]:
        """
        Get basic information about a CSV file.
        
        Args:
            filename: Name of the CSV file
        
        Returns:
            Dictionary with file metadata and structure information
        """
        try:
            return csv_manager.get_info(filename)
        except Exception as e:
            return {"success": False, "error": str(e)}
  • Core logic implementation of get_info in CSVManager class. Reads CSV file using pandas and computes metadata including row count, column info, file stats, data types, and memory usage.
    def get_info(self, filename: str) -> Dict[str, Any]:
        """Get basic information about a CSV file."""
        filepath = self._get_file_path(filename)
        
        if not filepath.exists():
            raise FileNotFoundError(f"CSV file '{filename}' not found")
        
        try:
            df = pd.read_csv(filepath)
            file_stat = filepath.stat()
            
            return {
                "success": True,
                "filename": filename,
                "filepath": str(filepath),
                "size_bytes": file_stat.st_size,
                "size_mb": round(file_stat.st_size / (1024 * 1024), 2),
                "modified_time": datetime.fromtimestamp(file_stat.st_mtime).isoformat(),
                "rows": len(df),
                "columns": len(df.columns),
                "column_names": list(df.columns),
                "dtypes": {col: str(dtype) for col, dtype in df.dtypes.items()},
                "memory_usage": df.memory_usage(deep=True).sum()
            }
        except Exception as e:
            logger.error(f"Failed to get CSV info: {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 of behavioral disclosure. It states the tool returns 'file metadata and structure information', which is helpful, but doesn't cover important aspects like whether it requires file existence, handles errors, has performance characteristics, or what specific metadata is included. This leaves significant gaps for a tool with no annotation support.

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 appropriately concise with three focused sentences that each serve a clear purpose: stating the tool's function, documenting the parameter, and describing the return value. The structure with labeled 'Args' and 'Returns' sections enhances readability without unnecessary verbosity.

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 has an output schema (which handles return value documentation) and a simple single-parameter input, the description is reasonably complete for basic understanding. However, with no annotations and multiple sibling tools that could cause confusion, it lacks sufficient context about behavioral characteristics and differentiation from alternatives.

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 description explicitly documents the single parameter ('filename: Name of the CSV file'), adding meaningful context beyond the input schema which has 0% description coverage. This fully compensates for the schema's lack of parameter documentation, making the parameter purpose clear despite the simple schema.

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 tool's purpose with a specific verb ('Get') and resource ('basic information about a CSV file'), making it easy to understand what the tool does. However, it doesn't differentiate from sibling tools like 'get_path_info' or 'get_statistics' that might also retrieve information about CSV files, preventing 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 'get_path_info', 'get_statistics', 'list_csv_files', and 'read_csv' that might overlap in functionality, there's no indication of what makes 'get_info' distinct or when it should be preferred over other information-retrieval tools.

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