Skip to main content
Glama
mlstudios-ai

MCP Mix Server

by mlstudios-ai

summarize_csv_file

Quickly summarize a CSV file by calculating and reporting its row and column count. Input the filename to retrieve the file's dimensions efficiently using the MCP Mix Server.

Instructions

Summarise a CVS file by reporting its number of rows and columns.

Args: filename (str): Name of the CSV file in the /data directory.

Returns: str: A string describing the file's dimensions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYes

Implementation Reference

  • The main handler function for the 'summarize_csv_file' tool, decorated with @mcp.tool() for registration. It delegates to read_csv_summary.
    @mcp.tool() def summarize_csv_file(filename: str) -> str: """ Summarise a CVS file by reporting its number of rows and columns. Args: filename (str): Name of the CSV file in the /data directory. Returns: str: A string describing the file's dimensions. """ return read_csv_summary(filename)
  • Helper function that reads the CSV file using pandas and returns a summary of rows and columns.
    def read_csv_summary(filename: str) -> str: """ Read a CSV file and return a simple summary. Args: filename (str): Name of the CSV file Returns: str: A string describing the file's concents. """ file_path = DATA_DIR / filename if not file_path.exists(): return f"File {filename} does not exist." df = pd.read_csv(file_path) return f"CSV file '{filename}' has {len(df)} rows and {len(df.columns)} columns."

Other Tools

Related 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/mlstudios-ai/mcp-mix-server'

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