Skip to main content
Glama
Cappybara12

OpenXAI MCP Server

by Cappybara12

load_dataset

Load datasets like german, compas, or adult for evaluating AI explanation methods through the OpenXAI MCP Server interface.

Instructions

Load a specific dataset from OpenXAI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_nameYesName of the dataset to load (e.g., german, compas, adult)
downloadNoWhether to download the dataset if not available locally

Implementation Reference

  • The primary handler function that executes the load_dataset tool. It retrieves dataset metadata for supported datasets (german, compas, adult), validates the dataset_name, and returns formatted information including dataset stats and a Python code example for loading the dataset using OpenXAI.
      async loadDataset(datasetName, download = true) {
        const datasetInfo = {
          german: {
            description: 'German Credit dataset loaded successfully',
            features: 20,
            samples: 1000,
            classes: 2,
            task: 'classification'
          },
          compas: {
            description: 'COMPAS Recidivism dataset loaded successfully',
            features: 11,
            samples: 6172,
            classes: 2,
            task: 'classification'
          },
          adult: {
            description: 'Adult Income dataset loaded successfully',
            features: 14,
            samples: 48842,
            classes: 2,
            task: 'classification'
          }
        };
    
        const info = datasetInfo[datasetName];
        if (!info) {
          throw new Error(`Dataset '${datasetName}' not found. Available datasets: ${Object.keys(datasetInfo).join(', ')}`);
        }
    
        const codeExample = `
    # Example usage with OpenXAI:
    from openxai.dataloader import ReturnLoaders
    
    # Load the dataset
    trainloader, testloader = ReturnLoaders(data_name='${datasetName}', download=${download})
    
    # Get a sample from the test dataset
    inputs, labels = next(iter(testloader))
    print(f"Input shape: {inputs.shape}")
    print(f"Labels shape: {labels.shape}")
    `;
    
        return {
          content: [
            {
              type: 'text',
              text: `${info.description}\n\n` +
                    `Dataset: ${datasetName}\n` +
                    `Features: ${info.features}\n` +
                    `Samples: ${info.samples}\n` +
                    `Classes: ${info.classes}\n` +
                    `Task: ${info.task}\n\n` +
                    `Python code example:\n\`\`\`python${codeExample}\`\`\``
            }
          ]
        };
      }
  • Input schema definition for the load_dataset tool, specifying dataset_name as required string and optional download boolean.
    inputSchema: {
      type: 'object',
      properties: {
        dataset_name: {
          type: 'string',
          description: 'Name of the dataset to load (e.g., german, compas, adult)',
        },
        download: {
          type: 'boolean',
          description: 'Whether to download the dataset if not available locally',
          default: true
        }
      },
      required: ['dataset_name']
    }
  • index.js:53-71 (registration)
    Registration of the load_dataset tool in the MCP server's tool list, including name, description, and input schema.
    {
      name: 'load_dataset',
      description: 'Load a specific dataset from OpenXAI',
      inputSchema: {
        type: 'object',
        properties: {
          dataset_name: {
            type: 'string',
            description: 'Name of the dataset to load (e.g., german, compas, adult)',
          },
          download: {
            type: 'boolean',
            description: 'Whether to download the dataset if not available locally',
            default: true
          }
        },
        required: ['dataset_name']
      }
    },
  • Dispatch case in the CallToolRequestHandler that routes load_dataset calls to the loadDataset method.
    case 'load_dataset':
      return await this.loadDataset(args.dataset_name, args.download);
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 the action 'load' but doesn't explain what that entails—e.g., whether it returns data, loads into memory, requires internet for download, or has side effects like caching. For a tool with no annotations, this is a significant gap in transparency.

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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly. Every part of the sentence earns its place by conveying essential information.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete. It doesn't cover what the tool returns (e.g., a dataset object, file path, or status), error conditions, or behavioral details like download behavior. For a tool that likely involves data retrieval and potential network operations, more context is needed to guide effective use.

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?

The input schema has 100% description coverage, with clear parameter details (e.g., dataset_name examples, download default). The description adds no additional meaning beyond the schema, such as explaining dataset formats or download implications. With high schema coverage, a baseline score of 3 is appropriate as 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 verb 'load' and the resource 'a specific dataset from OpenXAI', which makes the purpose understandable. However, it doesn't explicitly differentiate from sibling tools like 'list_datasets' (which likely lists available datasets) or 'load_model' (which loads models rather than datasets), missing an opportunity for full sibling distinction.

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 prerequisites (e.g., dataset availability), when not to use it, or how it relates to siblings like 'list_datasets' (which might be needed first to see available datasets). This leaves the agent without contextual usage cues.

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/Cappybara12/mcpopenxAI'

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