Skip to main content
Glama
cfahlgren1

HF Dataset MCP

by cfahlgren1

validate_dataset

Verify dataset accessibility and identify available viewer features for Hugging Face datasets to ensure compatibility and functionality.

Instructions

Check if a dataset is accessible and which viewer features are available

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetYesDataset ID (e.g., 'stanfordnlp/imdb')

Implementation Reference

  • The handler function for the validate_dataset tool which calls the internal fetchDatasetViewer to validate a dataset.
    async ({ dataset }) => {
      const data = await fetchDatasetViewer<ValidResponse>("/is-valid", {
        dataset,
      });
    
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify(data, null, 2),
          },
        ],
      };
    }
  • Input schema for the validate_dataset tool using zod.
    {
      dataset: z.string().describe("Dataset ID (e.g., 'stanfordnlp/imdb')"),
    },
  • Registration of the validate_dataset tool within the MCP server.
    server.tool(
      "validate_dataset",
      "Check if a dataset is accessible and which viewer features are available",
      {
        dataset: z.string().describe("Dataset ID (e.g., 'stanfordnlp/imdb')"),
      },
      async ({ dataset }) => {
        const data = await fetchDatasetViewer<ValidResponse>("/is-valid", {
          dataset,
        });
    
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(data, null, 2),
            },
          ],
        };
      }
    );

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