Skip to main content
Glama
cfahlgren1

HF Dataset MCP

by cfahlgren1

get_dataset_info

Retrieve dataset schema, metadata, and row counts to understand structure and content before analysis or processing.

Instructions

Get the schema, metadata, and row counts for a dataset configuration

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetYesDataset ID (e.g., 'stanfordnlp/imdb')
configYesConfiguration name (from list_splits)

Implementation Reference

  • The handler function for the 'get_dataset_info' tool that executes the logic.
    async ({ dataset, config }) => {
      const data = await fetchDatasetViewer<InfoResponse>("/info", {
        dataset,
        config,
      });
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • The interface defining the structure of the dataset info response.
    interface InfoResponse {
      dataset_info: {
        description?: string;
        citation?: string;
        homepage?: string;
        license?: string;
        features?: Record<string, unknown>;
        builder_name?: string;
        dataset_name?: string;
        config_name?: string;
        version?: Record<string, unknown>;
        splits?: Record<
          string,
          {
            num_examples: number;
            num_bytes: number;
          }
        >;
        download_size?: number;
        dataset_size?: number;
      };
      partial: boolean;
    }
  • The function that registers the 'get_dataset_info' tool with the McpServer instance.
    export function registerGetDatasetInfo(server: McpServer) {
      server.tool(
        "get_dataset_info",
        "Get the schema, metadata, and row counts for a dataset configuration",
        {
          dataset: z.string().describe("Dataset ID (e.g., 'stanfordnlp/imdb')"),
          config: z.string().describe("Configuration name (from list_splits)"),
        },
        async ({ dataset, config }) => {
          const data = await fetchDatasetViewer<InfoResponse>("/info", {
            dataset,
            config,
          });
    
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify(data, null, 2),
              },
            ],
          };
        }
      );
    }
Behavior3/5

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

With no annotations, description carries full burden. 'Get' implies read-only safety. Discloses return content (schema, metadata, counts) but omits output format, caching behavior, performance characteristics, or error conditions.

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?

Single efficient sentence, front-loaded with action and deliverables. No redundancy or waste.

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?

Adequate for 2-parameter read tool: describes return values to compensate for missing output schema. Could strengthen by clarifying relationship to `list_splits` prerequisite and distinguishing from statistical/size siblings.

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?

Schema coverage is 100% with clear parameter descriptions (including example format for dataset ID and provenance hint for config). Description adds no param-specific guidance, warranting baseline 3.

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?

States specific deliverables (schema, metadata, row counts) and target resource (dataset configuration). Lacks explicit differentiation from siblings like `get_dataset_size` or `get_statistics` which may also return counts/stats.

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?

Provides no guidance on when to prefer this over siblings (e.g., `get_dataset_size` for just size, `list_splits` to first discover configs). No workflow context despite the `config` parameter implying dependency on `list_splits`.

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