Skip to main content
Glama
shibuiwilliam

MCP Data Wrangler

data_max_horizontal

Calculate maximum values across columns for each row in your dataset using this preprocessing tool. Ideal for data aggregation and transformation tasks, ensuring efficient row-wise analysis.

Instructions

Maximum 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 that executes the 'data_max_horizontal' tool logic: loads data, computes max across columns per row, returns JSON.
    async def handle_data_max_horizontal(
        arguments: dict[str, Any],
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        data_max_input = DataMaxInputSchema.from_args(arguments)
        try:
            max_horizontal_df = data_max_input.df.max_horizontal()
    
            # Convert the DataFrame to a dictionary format
            max_horizontal_dict = {
                "description": "Maximum values across columns for each row",
                "max_values": {str(i): str(val) if val is not None else None for i, val in enumerate(max_horizontal_df)},
            }
    
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(max_horizontal_dict),
                )
            ]
        except Exception as e:
            logger.error(f"Error calculating max: {e}")
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(
                        {
                            "error": "Failed to calculate max values.",
                            "message": str(e),
                        }
                    ),
                )
            ]
  • Pydantic schema for input validation: requires input_data_file_path, loads Dataframe.
    class DataMaxInputSchema(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) -> "DataMaxInputSchema":
            data = Data.from_file(input_data_file_path)
            return DataMaxInputSchema(df=data.df)
    
        @staticmethod
        def from_args(arguments: dict[str, Any]) -> "DataMaxInputSchema":
            input_data_file_path = arguments["input_data_file_path"]
            return DataMaxInputSchema.from_schema(input_data_file_path=input_data_file_path)
  • Tool registration in MCPServerDataWrangler.tools(): defines name, description, and inputSchema.
    types.Tool(
        name=MCPServerDataWrangler.data_max_horizontal.value[0],
        description=MCPServerDataWrangler.data_max_horizontal.value[1],
        inputSchema=DataMaxInputSchema.input_schema(),
    ),
  • Handler mapping in MCPServerDataWrangler.tool_to_handler(): maps tool name to handle_data_max_horizontal.
    MCPServerDataWrangler.data_max.value[0]: handle_data_max,
    MCPServerDataWrangler.data_max_horizontal.value[0]: handle_data_max_horizontal,
    MCPServerDataWrangler.data_min.value[0]: handle_data_min,
  • Enum definition in MCPServerDataWrangler providing the tool name and description.
    data_max_horizontal = ("data_max_horizontal", "Maximum values across columns for each row")
Behavior2/5

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

No annotations are provided, so the description carries full burden. While 'Maximum values' implies a read-only calculation, the description doesn't disclose important behavioral traits: what format the input file should be, whether the operation modifies data, what the output looks like, or any error conditions. For a tool with no annotation coverage, this is inadequate.

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 5 words, front-loaded with the core functionality. Every word earns its place by specifying the operation, scope, and orientation. There's zero waste or redundancy.

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 no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (presumably maximum values per row), what format the input should be, or how results are presented. For a data processing tool with 1 parameter but no structured output documentation, more context 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 the single parameter 'input_data_file_path' well-documented in the schema. The description adds no additional parameter information beyond what the schema provides, which is acceptable given the high schema coverage. The baseline of 3 is appropriate when the schema does the heavy lifting.

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 verb 'Maximum values' and the resource 'across columns for each row', which specifies what the tool does. It distinguishes from some siblings like data_count or data_shape, but doesn't explicitly differentiate from data_max (which might be vertical) or data_min_horizontal (which is the opposite operation).

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 many sibling tools performing different statistical operations (mean, median, min, max, etc.), there's no indication of when horizontal maximum calculation is appropriate versus vertical maximum or other aggregations.

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