Skip to main content
Glama
shibuiwilliam

MCP Data Wrangler

data_product

Extract product values for each column in a dataset. Uses the MCP Data Wrangler server to process and analyze data, enabling structured data transformation and preprocessing tasks.

Instructions

Product values for each column

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_data_file_pathNoPath to the input data file

Implementation Reference

  • The handler function for the 'data_product' tool. It loads data from the input file path, computes the product for each column, formats it as a dictionary, and returns it as JSON text content.
    async def handle_data_product(
        arguments: dict[str, Any],
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        data_product_input = DataProductInputSchema.from_args(arguments)
        product_df = data_product_input.df.product()
    
        # Convert the DataFrame to a dictionary format
        product_dict = {
            "description": "Product values for each column",
            "product_values": {
                col: str(val) if val is not None else None for col, val in zip(product_df.columns, product_df.row(0))
            },
        }
    
        return [
            types.TextContent(
                type="text",
                text=json.dumps(product_dict),
            )
        ]
  • Pydantic model and methods defining the input schema and parsing for the data_product tool.
    class DataProductInputSchema(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) -> "DataProductInputSchema":
            data = Data.from_file(input_data_file_path)
            return DataProductInputSchema(df=data.df)
    
        @staticmethod
        def from_args(arguments: dict[str, Any]) -> "DataProductInputSchema":
            input_data_file_path = arguments["input_data_file_path"]
            return DataProductInputSchema.from_schema(input_data_file_path=input_data_file_path)
  • Creates and registers the 'data_product' Tool object with MCP types.Tool, specifying name, description, and inputSchema.
    types.Tool(
        name=MCPServerDataWrangler.data_product.value[0],
        description=MCPServerDataWrangler.data_product.value[1],
        inputSchema=DataProductInputSchema.input_schema(),
    ),
  • Maps the 'data_product' tool name to its handler function in the tool_to_handler dictionary.
    MCPServerDataWrangler.data_product.value[0]: handle_data_product,
  • Defines the tool name and description in the MCPServerDataWrangler enum.
    data_product = ("data_product", "Product values for each column")
Behavior1/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It fails to do so—it does not explain what 'product' means operationally, whether it modifies data, requires specific permissions, handles errors, or what the output looks like. This leaves critical behavioral aspects undefined.

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—a single phrase—and front-loaded with the core purpose. There is no wasted language, making it efficient in structure, though this brevity contributes to its lack of clarity and completeness.

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

Completeness1/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 processing tool with no annotations, no output schema, and vague purpose, the description is incomplete. It does not explain what 'product' computes, how results are returned, or any prerequisites, failing to provide adequate context for effective tool use.

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?

The input schema has 100% description coverage, with one parameter clearly documented as 'Path to the input data file'. The description adds no additional meaning about parameters beyond what the schema provides, so it meets the baseline of 3 for high schema coverage without compensating value.

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

Purpose2/5

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

The description 'Product values for each column' is vague and tautological—it essentially restates the tool name 'data_product' without specifying what operation 'product' refers to (e.g., multiplication, aggregation, or something else). It does not clearly distinguish this tool from siblings like data_max or data_mean, which also operate on columns but with different functions.

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

Usage Guidelines1/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_max, data_mean, and data_quantile available, there is no indication of what 'product' calculates or in what scenarios it is preferred over other statistical tools, leaving the agent without usage context.

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