Skip to main content
Glama
shibuiwilliam

MCP Data Wrangler

data_std

Calculate standard deviation for each column in a dataset. Specify input file path and delta degrees of freedom (ddof) for precise statistical analysis.

Instructions

Standard deviation values for each column

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ddofNoDelta Degrees of Freedom: the divisor used in the calculation is N - ddof
input_data_file_pathYesPath to the input data file

Implementation Reference

  • The main handler function that processes input arguments, computes standard deviation on the dataframe columns, and returns the result as JSON text content.
    async def handle_data_std(
        arguments: dict[str, Any],
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        data_std_input = DataStdInputSchema.from_args(arguments)
        std_df = data_std_input.df.std(ddof=data_std_input.ddof)
    
        # Convert the DataFrame to a dictionary format
        std_dict = {
            "description": f"Standard deviation values for each column with ddof={data_std_input.ddof}",
            "std_values": {col: str(val) if val is not None else None for col, val in zip(std_df.columns, std_df.row(0))},
        }
    
        return [
            types.TextContent(
                type="text",
                text=json.dumps(std_dict),
            )
        ]
  • Pydantic input schema class for validating tool arguments, defining the JSON schema, and loading data from file into a dataframe with optional ddof parameter.
    class DataStdInputSchema(Data):
        model_config = ConfigDict(
            validate_assignment=True,
            frozen=True,
            extra="forbid",
            arbitrary_types_allowed=True,
        )
    
        ddof: int = Field(
            default=1, description="Delta Degrees of Freedom: the divisor used in the calculation is N - ddof", ge=0
        )
    
        @staticmethod
        def input_schema() -> dict:
            return {
                "type": "object",
                "properties": {
                    "input_data_file_path": {
                        "type": "string",
                        "description": "Path to the input data file",
                    },
                    "ddof": {
                        "type": "integer",
                        "description": "Delta Degrees of Freedom: the divisor used in the calculation is N - ddof",
                        "minimum": 0,
                        "default": 1,
                    },
                },
                "required": ["input_data_file_path"],
            }
    
        @staticmethod
        def from_schema(input_data_file_path: str, ddof: int = 1) -> "DataStdInputSchema":
            data = Data.from_file(input_data_file_path)
            return DataStdInputSchema(
                df=data.df,
                ddof=ddof,
            )
    
        @staticmethod
        def from_args(arguments: dict[str, Any]) -> "DataStdInputSchema":
            input_data_file_path = arguments["input_data_file_path"]
            ddof = arguments.get("ddof", 1)
            return DataStdInputSchema.from_schema(
                input_data_file_path=input_data_file_path,
                ddof=ddof,
            )
  • Registers the 'data_std' tool in the MCP tools list with name, description, and input schema.
    types.Tool(
        name=MCPServerDataWrangler.data_std.value[0],
        description=MCPServerDataWrangler.data_std.value[1],
        inputSchema=DataStdInputSchema.input_schema(),
    ),
  • Maps the 'data_std' tool name to its handler function in the tool-to-handler dictionary.
    MCPServerDataWrangler.data_std.value[0]: handle_data_std,
  • Defines the tool name and description in the MCPServerDataWrangler enum.
    data_std = ("data_std", "Standard deviation values for each column")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what is computed, without mentioning how the tool behaves (e.g., it reads a file, processes numeric data, returns a list or dict, potential errors for non-numeric columns, or performance considerations). For a tool with no annotations, this is a significant gap in transparency.

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 a single, efficient sentence that directly states the tool's output. It's appropriately sized and front-loaded with the key information. However, it could be slightly more structured by including a brief example or context, but it avoids unnecessary verbosity.

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?

Given the tool's complexity (statistical computation with parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't explain the return format (e.g., a dictionary mapping columns to std values), error handling, or data requirements. For a tool with siblings and no structured output info, more context is needed to be fully helpful.

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?

Schema description coverage is 100%, so the schema fully documents both parameters ('input_data_file_path' and 'ddof'). The description adds no parameter semantics beyond what the schema provides (e.g., it doesn't explain file format expectations or the practical impact of 'ddof'). With high schema coverage, the baseline is 3, and the description doesn't compensate with extra insights.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states what the tool calculates ('Standard deviation values for each column'), which provides a basic purpose. However, it's vague about the resource (what data is being processed) and doesn't distinguish it from sibling tools like 'data_var' (variance) or 'describe_data' (which might include std). It specifies 'for each column' which helps, but lacks the specific verb+resource clarity needed for higher scores.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'data_var' (variance), 'data_mean' (mean), and 'describe_data' (comprehensive stats), there's no indication of when standard deviation is preferred or what context it applies to. This leaves the agent without usage direction.

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

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/shibuiwilliam/mcp-server-data-wrangler'

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