Skip to main content
Glama
shibuiwilliam

MCP Data Wrangler

data_shape

Analyze and extract the structure and format of input data files to understand key characteristics for preprocessing and transformation tasks.

Instructions

Data shape of the input data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_data_file_pathNoPath to the input data file

Implementation Reference

  • The async handler function for the 'data_shape' tool. Parses input arguments, loads the DataFrame from the specified file, computes its shape (rows and columns), and returns a JSON-formatted text content with the results.
    async def handle_data_shape(
        arguments: dict[str, Any],
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        data_shape_input = DataShapeInputSchema.from_args(arguments)
        data_shape = data_shape_input.df.shape
        num_rows = data_shape[0]
        num_cols = data_shape[1]
        return [
            types.TextContent(
                type="text",
                text=json.dumps(
                    {
                        "description": "Data shape of the input data",
                        "rows": num_rows,
                        "cols": num_cols,
                    }
                ),
            )
        ]
  • Pydantic model defining the input schema for the 'data_shape' tool. Subclass of Data, provides input_schema() method returning the JSON schema for MCP Tool inputSchema, and factory methods to construct from file path or arguments by loading the DataFrame.
    class DataShapeInputSchema(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(inuput_data_file_path: str) -> "DataShapeInputSchema":
            data = Data.from_file(inuput_data_file_path)
            return DataShapeInputSchema(df=data.df)
    
        @staticmethod
        def from_args(arguments: dict[str, Any]) -> "DataShapeInputSchema":
            input_data_file_path = arguments["input_data_file_path"]
            return DataShapeInputSchema.from_schema(inuput_data_file_path=input_data_file_path)
  • Registration of the 'data_shape' tool in the MCPServerDataWrangler.tools() static method, creating the MCP types.Tool object with name, description from enum, and inputSchema from DataShapeInputSchema.input_schema().
    types.Tool(
        name=MCPServerDataWrangler.data_shape.value[0],
        description=MCPServerDataWrangler.data_shape.value[1],
        inputSchema=DataShapeInputSchema.input_schema(),
    ),
  • Handler registration for 'data_shape' tool in the MCPServerDataWrangler.tool_to_handler() dict, mapping the tool name to the handle_data_shape function.
    MCPServerDataWrangler.data_shape.value[0]: handle_data_shape,
  • Enum definition for 'data_shape' in MCPServerDataWrangler, providing the tool name and description used in tool registration.
    data_shape = ("data_shape", "Data shape of the input data")
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description gives no indication of what 'data shape' means operationally, whether this is a read-only analysis, what format the output takes, or any computational characteristics. It fails to provide meaningful behavioral context.

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

Conciseness2/5

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

While technically concise at 5 words, this is under-specification rather than effective brevity. The description fails to convey essential information about the tool's purpose and behavior, making it inefficient despite its short length.

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 vague description, this is inadequate for a data analysis tool. The description doesn't explain what 'data shape' means, what information it returns, or how it differs from similar tools like data_schema. The context is insufficient for an agent to understand when and how to use this tool.

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?

With 100% schema description coverage, the input schema already fully documents the single parameter. The description adds no additional semantic context about the parameter beyond what's in the schema. The baseline score of 3 reflects adequate coverage through the schema alone.

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 'Data shape of the input data' is a tautology that essentially restates the tool name 'data_shape' without specifying what action it performs. It doesn't provide a clear verb (e.g., 'analyze', 'calculate', 'return') or distinguish this tool from its many siblings that also operate on data.

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 14 sibling tools including data_schema and describe_data that might serve similar purposes, there's no indication of what differentiates this tool or when it's appropriate to select it.

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