Skip to main content
Glama
shibuiwilliam

MCP Data Wrangler

data_max

Extract maximum values for each column in a dataset with MCP Data Wrangler to simplify data analysis and preprocessing tasks.

Instructions

Maximum values for each column

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_data_file_pathNoPath to the input data file

Implementation Reference

  • The main handler function for the 'data_max' MCP tool. It parses input arguments using the schema, computes the maximum value for each column in the dataframe, formats the result as JSON, and returns it as TextContent.
    async def handle_data_max(
        arguments: dict[str, Any],
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        data_max_input = DataMaxInputSchema.from_args(arguments)
        max_df = data_max_input.df.max()
    
        # Convert the DataFrame to a dictionary format
        max_dict = {
            "description": "Maximum values for each column",
            "max_values": {col: str(val) if val is not None else None for col, val in zip(max_df.columns, max_df.row(0))},
        }
    
        return [
            types.TextContent(
                type="text",
                text=json.dumps(max_dict),
            )
        ]
  • Pydantic schema class for 'data_max' tool input validation. Defines the JSON input schema via input_schema(), and provides factory methods to construct from file path or arguments.
    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)
  • Registration of the 'data_max' tool in the MCPServerDataWrangler.tools() static method, specifying name, description, and input schema.
    types.Tool(
        name=MCPServerDataWrangler.data_max.value[0],
        description=MCPServerDataWrangler.data_max.value[1],
        inputSchema=DataMaxInputSchema.input_schema(),
    ),
  • Static method providing the mapping from tool names to their handler functions, including 'data_max' mapped to handle_data_max.
    def tool_to_handler() -> dict[str, Callable]:
        return {
            MCPServerDataWrangler.data_shape.value[0]: handle_data_shape,
            MCPServerDataWrangler.data_schema.value[0]: handle_data_schema,
            MCPServerDataWrangler.describe_data.value[0]: handle_describe_data,
            MCPServerDataWrangler.data_estimated_size.value[0]: handle_data_estimated_size,
            MCPServerDataWrangler.data_count.value[0]: handle_data_count,
            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,
            MCPServerDataWrangler.data_min_horizontal.value[0]: handle_data_min_horizontal,
            MCPServerDataWrangler.data_mean.value[0]: handle_data_mean,
            MCPServerDataWrangler.data_mean_horizontal.value[0]: handle_data_mean_horizontal,
            MCPServerDataWrangler.data_median.value[0]: handle_data_median,
            MCPServerDataWrangler.data_product.value[0]: handle_data_product,
            MCPServerDataWrangler.data_quantile.value[0]: handle_data_quantile,
            MCPServerDataWrangler.data_std.value[0]: handle_data_std,
            MCPServerDataWrangler.data_var.value[0]: handle_data_var,
        }
  • Enum member defining the tool name and description for 'data_max' in MCPServerDataWrangler.
    data_max = ("data_max", "Maximum 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 full burden. It mentions 'Maximum values for each column' but doesn't disclose behavioral traits like whether it handles missing data, requires numeric columns, returns errors for non-numeric data, or outputs format (e.g., list, dictionary). This leaves significant gaps for a tool that processes data files.

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 'Maximum values for each column' is extremely concise and front-loaded, with no wasted words. It directly conveys the core purpose in a single phrase, making it easy to scan and understand quickly.

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, no output schema, and a single parameter with full schema coverage, the description is incomplete. It doesn't explain what the tool returns (e.g., a dictionary of column max values), error conditions, or data processing behavior, which are crucial for a data analysis tool with many siblings.

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% (the single parameter 'input_data_file_path' is documented as 'Path to the input data file'), so the baseline is 3. The description adds no additional parameter semantics beyond what the schema provides, such as file format requirements or path examples.

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 'Maximum values for each column' clearly states the tool's function (calculating maximum values) and resource (columns in data). It distinguishes from siblings like data_min (minimum values) and data_mean (average values), though not explicitly. However, it doesn't specify the verb (e.g., 'calculate' or 'compute'), keeping it from a perfect score.

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_min, data_mean, and describe_data (which might include max values), there's no indication of when this specific maximum calculation is preferred or what distinguishes it from similar tools.

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