Skip to main content
Glama
michaelwaves

Hugging Face Hub MCP Server

by michaelwaves

hf_get_dataset_info

Retrieve comprehensive details about a dataset, including metadata, files, and configurations from the Hugging Face Hub. Specify the dataset repository ID and optional revision for targeted information.

Instructions

Get detailed information for a specific dataset including metadata, files, configuration, and more.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fullNoWhether to fetch most dataset data including all tags and files
repo_idYesDataset repository ID (e.g., 'squad', 'imdb')
revisionNoOptional git revision (branch, tag, or commit hash)

Implementation Reference

  • The handler function that executes the tool logic: validates arguments, calls the HuggingFaceClient to retrieve dataset information, and returns formatted result or error.
    export async function handleGetDatasetInfo(client: HuggingFaceClient, args: unknown): Promise<CallToolResult> {
        try {
            if (!isDatasetInfoArgs(args)) {
                throw new Error("Invalid arguments for hf_get_dataset_info");
            }
    
            const { repo_id, revision, full } = args;
            const params = full ? { full } : {};
            const results = await client.getDatasetInfo(repo_id, revision, params);
            
            return {
                content: [{ type: "text", text: results }],
                isError: false,
            };
        } catch (error) {
            return {
                content: [
                    {
                        type: "text",
                        text: `Error: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
                isError: true,
            };
        }
    }
  • Tool definition object containing the name, description, and input schema (JSON schema) for validating tool arguments.
    export const getDatasetInfoToolDefinition: Tool = {
        name: "hf_get_dataset_info",
        description:
            "Get detailed information for a specific dataset including metadata, files, configuration, and more.",
        inputSchema: {
            type: "object",
            properties: {
                repo_id: {
                    type: "string",
                    description: "Dataset repository ID (e.g., 'squad', 'imdb')"
                },
                revision: {
                    type: "string", 
                    description: "Optional git revision (branch, tag, or commit hash)"
                },
                full: {
                    type: "boolean",
                    description: "Whether to fetch most dataset data including all tags and files"
                }
            },
            required: ["repo_id"]
        }
    };
  • src/server.ts:84-85 (registration)
    Registration in the tool dispatch switch statement: routes calls to 'hf_get_dataset_info' to the handleGetDatasetInfo handler.
    case 'hf_get_dataset_info':
        return handleGetDatasetInfo(this.client, args);
  • src/server.ts:57-64 (registration)
    Registration of the tool definition in the ListToolsRequest handler, making the schema available to clients.
    listModelsToolDefinition,
    getModelInfoToolDefinition,
    getModelTagsToolDefinition,
    listDatasetsToolDefinition,
    getDatasetInfoToolDefinition,
    getDatasetParquetToolDefinition,
    getCroissantToolDefinition,
    getDatasetTagsToolDefinition
  • Type guard helper function used by the handler to validate input arguments before processing.
    function isDatasetInfoArgs(args: unknown): args is DatasetInfoArgs {
        return (
            typeof args === "object" &&
            args !== null &&
            "repo_id" in args &&
            typeof (args as { repo_id: string }).repo_id === "string"
        );
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. It states what information is retrieved but doesn't describe the response format, potential rate limits, authentication needs, or whether this is a read-only operation (though implied by 'Get'). For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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?

The description is a single, efficient sentence that front-loads the core purpose ('Get detailed information for a specific dataset') and adds useful specifics ('including metadata, files, configuration, and more') without any wasted words. Every part of the sentence earns its place.

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?

Given the tool's moderate complexity (3 parameters, 1 required) and lack of annotations or output schema, the description is minimally adequate. It covers the basic purpose but doesn't compensate for missing behavioral details or output expectations, leaving the agent to infer the full context from the schema alone.

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 description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter semantics beyond what the schema provides, such as examples for 'repo_id' beyond the schema's 'squad' and 'imdb', or clarification on how 'full' interacts with the other parameters. Baseline 3 is appropriate when the schema does the heavy lifting.

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 clearly states the tool's purpose with a specific verb ('Get') and resource ('detailed information for a specific dataset'), and it enumerates the types of information retrieved (metadata, files, configuration). However, it doesn't explicitly differentiate from sibling tools like 'hf_get_dataset_tags' or 'hf_get_dataset_parquet' that might provide more focused information subsets.

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. It doesn't mention sibling tools like 'hf_list_datasets' for browsing datasets or 'hf_get_dataset_tags' for just tags, nor does it specify prerequisites or contextual constraints for usage.

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

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