Skip to main content
Glama
cfahlgren1

HF Dataset MCP

by cfahlgren1

get_statistics

Generate descriptive statistics for each column in a Hugging Face dataset split to analyze data distribution and characteristics.

Instructions

Get descriptive statistics for each column in a dataset split

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetYesDataset ID (e.g., 'stanfordnlp/imdb')
configYesConfiguration name
splitYesSplit name (train, test, validation)

Implementation Reference

  • The handler function that executes the 'get_statistics' tool logic by calling fetchDatasetViewer.
    async ({ dataset, config, split }) => {
      const data = await fetchDatasetViewer<StatisticsResponse>("/statistics", {
        dataset,
        config,
        split,
      });
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Input schema definition for the 'get_statistics' tool using Zod.
    {
      dataset: z.string().describe("Dataset ID (e.g., 'stanfordnlp/imdb')"),
      config: z.string().describe("Configuration name"),
      split: z.string().describe("Split name (train, test, validation)"),
    },
  • Registration function that registers the 'get_statistics' tool with the McpServer.
    export function registerGetStatistics(server: McpServer) {
      server.tool(
        "get_statistics",
        "Get descriptive statistics for each column in a dataset split",
        {
          dataset: z.string().describe("Dataset ID (e.g., 'stanfordnlp/imdb')"),
          config: z.string().describe("Configuration name"),
          split: z.string().describe("Split name (train, test, validation)"),
        },
        async ({ dataset, config, split }) => {
          const data = await fetchDatasetViewer<StatisticsResponse>("/statistics", {
            dataset,
            config,
            split,
          });
    
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(data, null, 2),
              },
            ],
          };
        }
      );
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'descriptive statistics' hints at the operation type (mean, std, etc.), it fails to specify the exact statistics returned, whether the operation is cached, computational cost for large datasets, or the output format/structure.

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

Conciseness4/5

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

The single sentence is front-loaded with the action verb and contains zero redundancy. However, given the absence of annotations and output schema, the extreme brevity leaves significant behavioral context undocumented, preventing a score of 5.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 3 well-documented parameters (100% schema coverage) and a clear core purpose, the description is minimally viable. However, lacking annotations, output schema, and specifics about what statistics are computed, it leaves gaps in the agent's understanding of the tool's full capabilities and return values.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, establishing a baseline of 3. The description adds value by contextualizing the parameters as targeting a specific 'dataset split' and operating on 'each column' within it, which helps the agent understand the scope of the analysis beyond the individual parameter definitions.

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 uses specific verb 'Get' with clear resource 'descriptive statistics' and scope 'for each column in a dataset split'. It effectively distinguishes from siblings like get_dataset_info (general metadata) and get_rows (raw data) by specifying statistical aggregation at the column level.

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 like get_dataset_info or list_splits. It does not mention prerequisites (e.g., knowing valid config/split names) or when this might be computationally expensive versus lightweight alternatives.

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

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/cfahlgren1/hf-dataset-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server