Skip to main content
Glama
reading-plus-ai

mcp-server-data-exploration

load_csv

Load local CSV files into DataFrames for data exploration and analysis. Specify file paths and optionally name datasets for organized processing.

Instructions

Load CSV File Tool

Purpose: Load a local CSV file into a DataFrame.

Usage Notes: • If a df_name is not provided, the tool will automatically assign names sequentially as df_1, df_2, and so on.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
csv_pathYes
df_nameNo

Implementation Reference

  • Core handler implementation in ScriptRunner class that loads the CSV file using pandas.read_csv, assigns a dataframe name if not provided, stores it in memory, and returns a success message or raises an error.
    def load_csv(self, csv_path: str, df_name:str = None):
        self.df_count += 1
        if not df_name:
            df_name = f"df_{self.df_count}"
        try:
            self.data[df_name] = pd.read_csv(csv_path)
            self.notes.append(f"Successfully loaded CSV into dataframe '{df_name}'")
            return [
                TextContent(type="text", text=f"Successfully loaded CSV into dataframe '{df_name}'")
            ]
        except Exception as e:
            raise McpError(
                INTERNAL_ERROR, f"Error loading CSV: {str(e)}"
            ) from e
  • Pydantic BaseModel defining the input schema for the load_csv tool, with required csv_path (str) and optional df_name (str). Used for validation and tool registration.
    class LoadCsv(BaseModel):
        csv_path: str
        df_name: Optional[str] = None
  • Tool registration in the @server.list_tools() handler, specifying the name 'load_csv', description, and input schema from LoadCsv model.
    Tool(
        name = DataExplorationTools.LOAD_CSV,
        description = LOAD_CSV_TOOL_DESCRIPTION,
        inputSchema = LoadCsv.model_json_schema(),
    ),
  • Dispatch logic in the @server.call_tool() handler that extracts arguments and delegates to ScriptRunner.load_csv for execution.
    if name == DataExplorationTools.LOAD_CSV:
        csv_path = arguments.get("csv_path")
        df_name = arguments.get("df_name")
        return script_runner.load_csv(csv_path, df_name)
  • Enum defining the tool names, including LOAD_CSV = "load_csv", used throughout for registration and dispatching.
    class DataExplorationTools(str, Enum):
        LOAD_CSV = "load_csv"
        RUN_SCRIPT = "run_script"
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the automatic naming behavior when df_name is omitted, which is helpful. However, it doesn't address critical behavioral aspects like error handling, file format requirements, memory implications, or what happens if the CSV path is invalid.

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 well-structured with clear sections (Purpose, Usage Notes) and uses bullet points efficiently. Both sentences earn their place by providing essential information without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a data loading tool with no annotations, no output schema, and 0% schema description coverage, the description is insufficient. It doesn't explain what a DataFrame is in this context, what the tool returns, error conditions, or file format requirements. The description should provide more complete operational context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the schema provides no parameter documentation. The description partially compensates by explaining the df_name parameter's behavior when omitted, but doesn't clarify csv_path requirements or format. It adds some value but doesn't fully compensate for the complete lack of schema documentation.

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 as 'Load a local CSV file into a DataFrame' with specific verb ('Load') and resource ('CSV file'), making it immediately understandable. However, it doesn't differentiate from the sibling tool 'run_script', which appears unrelated but could potentially handle similar data operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides implied usage guidance through the 'Usage Notes' section about automatic naming when df_name isn't provided. However, it lacks explicit guidance on when to use this tool versus alternatives or any prerequisites for successful operation.

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/reading-plus-ai/mcp-server-data-exploration'

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