Skip to main content
Glama
shibuiwilliam

MCP Data Wrangler

data_schema

Analyze and validate the structure of input data files to ensure compatibility with data wrangling processes in the MCP Data Wrangler server.

Instructions

Data schema of the input data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
input_data_file_pathNoPath to the input data file

Implementation Reference

  • The main handler function for the 'data_schema' tool. It processes input arguments, loads the data using DataSchemaInputSchema, extracts the schema from the dataframe, converts it to a dictionary, and returns it as JSON text content.
    async def handle_data_schema(
        arguments: dict[str, Any],
    ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]:
        data_schema_input = DataSchemaInputSchema.from_args(arguments)
        schema = data_schema_input.df.schema
        schema_dict = {col: str(dtype) for col, dtype in schema.items()}
        return [
            types.TextContent(
                type="text",
                text=json.dumps(
                    {
                        "description": "Data schema of the input data",
                        "schema": schema_dict,
                    }
                ),
            )
        ]
  • Pydantic model defining the input schema for the 'data_schema' tool, including the JSON schema definition via input_schema(), and factory methods to load data from file or arguments.
    class DataSchemaInputSchema(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) -> "DataSchemaInputSchema":
            data = Data.from_file(input_data_file_path)
            return DataSchemaInputSchema(df=data.df)
    
        @staticmethod
        def from_args(arguments: dict[str, Any]) -> "DataSchemaInputSchema":
            input_data_file_path = arguments["input_data_file_path"]
            return DataSchemaInputSchema.from_schema(input_data_file_path=input_data_file_path)
  • Registration of the 'data_schema' tool in the list of MCP tools returned by MCPServerDataWrangler.tools(), specifying name, description, and input schema.
    types.Tool(
        name=MCPServerDataWrangler.data_schema.value[0],
        description=MCPServerDataWrangler.data_schema.value[1],
        inputSchema=DataSchemaInputSchema.input_schema(),
    ),
  • Mapping of the 'data_schema' tool name to its handler function in the tool_to_handler dictionary.
    MCPServerDataWrangler.data_schema.value[0]: handle_data_schema,
  • Enum definition providing the name and description for the 'data_schema' tool.
    data_schema = ("data_schema", "Data schema 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 fails to indicate whether this is a read operation, what format the output takes, whether it validates or just describes schemas, or any behavioral characteristics like error conditions or performance considerations.

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 with just 5 words, this is under-specification rather than effective conciseness. The description fails to provide essential information about the tool's purpose and behavior, making it inefficient for agent understanding despite its brevity.

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?

For a tool with no annotations and no output schema, the description is completely inadequate. It doesn't explain what the tool returns, how to interpret results, or what value it provides compared to sibling tools. The agent would have no idea what to expect from invoking 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 for the single parameter, the schema already documents that the tool takes a file path. The description adds no additional parameter semantics beyond what's in the schema, so the baseline score of 3 is appropriate when the schema does the documentation work.

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 schema of the input data' is a tautology that essentially restates the tool name 'data_schema' without specifying what action the tool performs. It doesn't indicate whether this retrieves, analyzes, validates, or generates schemas, nor does it 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 about when to use this tool versus alternatives. With 14 sibling tools all operating on data, there's no indication of what specific problem this tool solves or when it should be selected over tools like 'data_shape' or 'describe_data' which might provide related information.

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