Skip to main content
Glama

data_min

Identify minimum values for each column in a dataset using the MCP Data Wrangler server. Analyze data by providing the input file path for streamlined preprocessing and descriptive statistics.

Instructions

Minimum 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_min' tool, which computes the minimum value for each column in the input dataframe and returns it as JSON.
    async def handle_data_min( arguments: dict[str, Any], ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]: data_min_input = DataMinInputSchema.from_args(arguments) min_df = data_min_input.df.min() # Convert the DataFrame to a dictionary format min_dict = { "description": "Minimum values for each column", "min_values": {col: str(val) if val is not None else None for col, val in zip(min_df.columns, min_df.row(0))}, } return [ types.TextContent( type="text", text=json.dumps(min_dict), ) ]
  • Pydantic schema for input validation of the 'data_min' tool, including static methods to load data from file path argument.
    class DataMinInputSchema(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) -> "DataMinInputSchema": data = Data.from_file(input_data_file_path) return DataMinInputSchema(df=data.df) @staticmethod def from_args(arguments: dict[str, Any]) -> "DataMinInputSchema": input_data_file_path = arguments["input_data_file_path"] return DataMinInputSchema.from_schema(input_data_file_path=input_data_file_path)
  • Registration of the 'data_min' tool in the MCP tools list, specifying name, description, and input schema.
    types.Tool( name=MCPServerDataWrangler.data_min.value[0], description=MCPServerDataWrangler.data_min.value[1], inputSchema=DataMinInputSchema.input_schema(), ),
  • Mapping of the 'data_min' tool name to its handler function in the dispatch dictionary.
    MCPServerDataWrangler.data_min.value[0]: handle_data_min,
  • Enum definition associating 'data_min' with its name and description.
    data_min = ("data_min", "Minimum values for each column")

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