Skip to main content
Glama
K02D

MCP Tabular Data Analysis Server

by K02D

list_data_files

Lists available CSV and SQLite files in the project data directory to identify datasets for analysis.

Instructions

List available data files in the project data directory. Args: data_dir: Relative path to data directory (default: "data") Returns: Dictionary containing list of available CSV and SQLite files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
data_dirNodata

Implementation Reference

  • The main handler function for the 'list_data_files' tool. It lists CSV and SQLite files in the data directory, extracts metadata including file sizes and CSV column information, using the _resolve_path helper.
    def list_data_files(data_dir: str = "data") -> dict[str, Any]: """ List available data files in the project data directory. Args: data_dir: Relative path to data directory (default: "data") Returns: Dictionary containing list of available CSV and SQLite files """ data_path = _resolve_path(data_dir) if not data_path.exists(): return { "data_directory": str(data_path), "exists": False, "files": [] } csv_files = [] db_files = [] for file_path in sorted(data_path.iterdir()): if file_path.is_file(): suffix = file_path.suffix.lower() file_info = { "name": file_path.name, "path": str(file_path.relative_to(_PROJECT_ROOT)), "size_bytes": file_path.stat().st_size, } if suffix == ".csv": # Try to get basic info about CSV try: df = pd.read_csv(str(file_path), nrows=0) file_info["columns"] = df.columns.tolist() file_info["column_count"] = len(df.columns) except Exception: pass csv_files.append(file_info) elif suffix in (".db", ".sqlite", ".sqlite3"): db_files.append(file_info) return { "data_directory": str(data_path.relative_to(_PROJECT_ROOT)), "absolute_path": str(data_path), "csv_files": csv_files, "sqlite_files": db_files, "total_files": len(csv_files) + len(db_files), }

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/K02D/mcp-tabular'

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