Skip to main content
Glama

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

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

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