Skip to main content
Glama
privetin

Dataset Viewer MCP Server

by privetin

get_info

Retrieve detailed information about Hugging Face datasets including description, features, splits, and statistics. Validate dataset accessibility before fetching comprehensive metadata.

Instructions

Get detailed information about a Hugging Face dataset including description, features, splits, and statistics. Run validate first to check if the dataset exists and is accessible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
datasetYesHugging Face dataset identifier in the format owner/dataset
auth_tokenNoHugging Face auth token for private/gated datasets

Implementation Reference

  • The handler logic within the MCP tool dispatcher (@server.call_tool) that executes the get_info tool. It queries the Hugging Face datasets-server API /info endpoint directly and returns the dataset information as formatted JSON text content, handling 404 errors gracefully.
    if name == "get_info":
        dataset = arguments["dataset"]
        try:
            response = await DatasetViewerAPI(auth_token=auth_token).client.get("/info", params={"dataset": dataset})
            response.raise_for_status()
            result = response.json()
            return [
                types.TextContent(
                    type="text",
                    text=json.dumps(result, indent=2)
                )
            ]
        except httpx.HTTPStatusError as e:
            if e.response.status_code == 404:
                return [
                    types.TextContent(
                        type="text",
                        text=f"Dataset '{dataset}' not found"
                    )
                ]
            raise
  • Registration of the 'get_info' MCP tool in the @server.list_tools() handler, defining the tool name, description, and input schema for dataset parameter.
    types.Tool(
        name="get_info",
        description="Get detailed information about a Hugging Face dataset including description, features, splits, and statistics. Run validate first to check if the dataset exists and is accessible.",
        inputSchema={
            "type": "object",
            "properties": {
                "dataset": {
                    "type": "string",
                    "description": "Hugging Face dataset identifier in the format owner/dataset",
                    "pattern": "^[^/]+/[^/]+$",
                    "examples": ["ylecun/mnist", "stanfordnlp/imdb"]
                },
                "auth_token": {
                    "type": "string",
                    "description": "Hugging Face auth token for private/gated datasets",
                    "optional": True
                }
            },
            "required": ["dataset"],
        }
    ),
  • Input schema definition for the get_info tool, specifying the required 'dataset' parameter and optional auth_token.
    inputSchema={
        "type": "object",
        "properties": {
            "dataset": {
                "type": "string",
                "description": "Hugging Face dataset identifier in the format owner/dataset",
                "pattern": "^[^/]+/[^/]+$",
                "examples": ["ylecun/mnist", "stanfordnlp/imdb"]
            },
            "auth_token": {
                "type": "string",
                "description": "Hugging Face auth token for private/gated datasets",
                "optional": True
            }
        },
        "required": ["dataset"],
    }
  • Helper method in DatasetViewerAPI class that performs the core API call for dataset info (similar to tool handler logic), used for caching dataset state.
    async def get_info(self, dataset: str) -> dict:
        """Get detailed information about a dataset"""
        try:
            # Get detailed dataset info
            response = await self.client.get("/info", params={"dataset": dataset})
            response.raise_for_status()
            return response.json()
        except httpx.HTTPStatusError as e:
            if e.response.status_code == 404:
                raise ValueError(f"Dataset '{dataset}' not found")
            raise
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool retrieves detailed dataset information and mentions accessibility checking via validate, but lacks behavioral details like rate limits, error handling, or response format. It does not contradict annotations.

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?

Two sentences, front-loaded with core purpose and followed by usage guidance. Every sentence adds value without redundancy, making it efficiently structured and appropriately sized.

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 no annotations, no output schema, and 2 parameters with full schema coverage, the description is adequate but has gaps. It explains the tool's purpose and a prerequisite but lacks details on behavioral traits (e.g., response structure, error cases) that would enhance completeness for a read operation.

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 fully documents both parameters (dataset identifier format and optional auth token). The description adds no additional parameter semantics beyond what the schema provides, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get detailed information') and resource ('Hugging Face dataset'), listing key information types (description, features, splits, statistics). It distinguishes from siblings like get_statistics (subset) and validate (existence check).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance to 'Run validate first to check if the dataset exists and is accessible,' establishing a clear prerequisite. However, it does not specify when to use this tool versus alternatives like get_statistics or get_rows, missing sibling differentiation.

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/privetin/dataset-viewer'

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