Skip to main content
Glama

get_info

Retrieve file metadata and structure details for CSV files, including column information and data format specifications.

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

Implementation Reference

  • MCP tool handler for get_info, registered via @mcp.tool() decorator. Handles input validation implicitly via type hints and delegates execution to CSVManager.get_info() with error handling.
    @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 helper function in CSVManager that implements the get_info logic: loads CSV with pandas, computes metadata (rows, columns, names, dtypes, file stats), returns structured dict.
    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

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