Skip to main content
Glama
shibuiwilliam

MCP Data Wrangler

data_min_horizontal

Calculate minimum values across columns for each row in a dataset. Specify the input file path to process data and generate row-wise minimums using MCP Data Wrangler.

Instructions

Minimum values across columns for each row

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_data_file_pathNoPath to the input data file

Implementation Reference

  • The main handler function for the 'data_min_horizontal' tool. It parses input using DataMinInputSchema, computes df.min_horizontal(), formats results as JSON, and returns as TextContent. Handles exceptions.
    async def handle_data_min_horizontal(
        arguments: dict[str, Any],
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        data_min_input = DataMinInputSchema.from_args(arguments)
        try:
            min_horizontal_df = data_min_input.df.min_horizontal()
    
            # Convert the DataFrame to a dictionary format
            min_horizontal_dict = {
                "description": "Minimum values across columns for each row",
                "min_values": {str(i): str(val) if val is not None else None for i, val in enumerate(min_horizontal_df)},
            }
    
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(min_horizontal_dict),
                )
            ]
        except Exception as e:
            logger.error(f"Error calculating min: {e}")
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(
                        {
                            "error": "Failed to calculate min values.",
                            "message": str(e),
                        }
                    ),
                )
            ]
  • Pydantic schema for input validation. Defines input_schema() for the tool's inputSchema, loads Data from file, provides from_args/from_schema factory methods.
    class DataMinInputSchema(Data):
        model_config = ConfigDict(
            validate_assignment=True,
            frozen=True,
            extra="forbid",
            arbitrary_types_allowed=True,
        )
    
        @staticmethod
        def input_schema() -> dict:
            return {
                "type": "object",
                "properties": {
                    "input_data_file_path": {
                        "type": "string",
                        "description": "Path to the input data file",
                    },
                },
            }
    
        @staticmethod
        def from_schema(input_data_file_path: str) -> "DataMinInputSchema":
            data = Data.from_file(input_data_file_path)
            return DataMinInputSchema(df=data.df)
    
        @staticmethod
        def from_args(arguments: dict[str, Any]) -> "DataMinInputSchema":
            input_data_file_path = arguments["input_data_file_path"]
            return DataMinInputSchema.from_schema(input_data_file_path=input_data_file_path)
  • Tool registration in MCPServerDataWrangler.tools(): creates types.Tool object with name, description from enum, and inputSchema from DataMinInputSchema.
    types.Tool(
        name=MCPServerDataWrangler.data_min_horizontal.value[0],
        description=MCPServerDataWrangler.data_min_horizontal.value[1],
        inputSchema=DataMinInputSchema.input_schema(),
    ),
  • Handler mapping in MCPServerDataWrangler.tool_to_handler(): maps tool name to handle_data_min_horizontal function.
    MCPServerDataWrangler.data_min_horizontal.value[0]: handle_data_min_horizontal,
  • Enum definition in MCPServerDataWrangler providing the tool name and description used in registration.
    data_min_horizontal = ("data_min_horizontal", "Minimum values across columns for each row")
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 but provides minimal information. It states what the tool calculates but doesn't describe how it handles missing values, data types, errors, or the format of results. For a data transformation tool with zero annotation coverage, this leaves significant behavioral questions unanswered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise at just 6 words, with zero wasted language. It's front-loaded with the core functionality and uses precise mathematical terminology. Every word earns its place in communicating the essential operation.

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 complexity of a data transformation operation with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., modified dataset, summary statistics, new file), how results are formatted, or any limitations. For a tool that performs mathematical operations on data files, more context about behavior and outputs is needed.

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% with one parameter fully documented in the schema. The description adds no parameter-specific information beyond what the schema already provides about 'input_data_file_path'. Since the schema handles parameter documentation adequately, the baseline score of 3 is appropriate despite the description's lack of parameter details.

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 function: calculating minimum values across columns for each row. It uses specific mathematical terminology ('minimum values') and specifies the operation direction ('across columns for each row'), which distinguishes it from vertical operations. However, it doesn't explicitly differentiate from sibling tools like 'data_min' (which likely calculates minimums across rows for each column).

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. It doesn't mention sibling tools like 'data_min' (vertical minimum), 'data_max_horizontal' (horizontal maximum), or other statistical operations. There's no context about appropriate data types, when horizontal vs vertical operations are needed, or prerequisites for using this tool.

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