Skip to main content
Glama
Cappybara12

OpenXAI MCP Server

by Cappybara12

list_models

Retrieve available pre-trained AI models for evaluating explanation methods, with options to filter by dataset or model type.

Instructions

List available pre-trained models in OpenXAI

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataset_nameNoFilter models by dataset they were trained on
model_typeNoFilter by model type (ann, lr, rf, etc.)

Implementation Reference

  • The handler function that implements the list_models tool logic. It defines available models, filters them by dataset_name and model_type, and returns a formatted list.
    async listModels(datasetName, modelType) {
      const models = {
        ann: {
          name: 'Artificial Neural Network',
          description: 'Multi-layer perceptron with configurable architecture',
          supported_datasets: ['german', 'compas', 'adult', 'folktable', 'mnist', 'cifar10'],
          task_types: ['classification', 'regression']
        },
        lr: {
          name: 'Logistic Regression',
          description: 'Linear model for classification with ground truth explanations',
          supported_datasets: ['german', 'compas', 'adult', 'folktable'],
          task_types: ['classification']
        },
        rf: {
          name: 'Random Forest',
          description: 'Ensemble of decision trees',
          supported_datasets: ['german', 'compas', 'adult', 'folktable'],
          task_types: ['classification', 'regression']
        },
        svm: {
          name: 'Support Vector Machine',
          description: 'Kernel-based classification model',
          supported_datasets: ['german', 'compas', 'adult', 'folktable'],
          task_types: ['classification']
        },
        xgb: {
          name: 'XGBoost',
          description: 'Gradient boosting framework',
          supported_datasets: ['german', 'compas', 'adult', 'folktable'],
          task_types: ['classification', 'regression']
        }
      };
    
      let result = [];
      if (modelType === 'all') {
        result = Object.entries(models).map(([key, value]) => ({
          type: key,
          ...value
        }));
      } else {
        result = models[modelType] ? [{ type: modelType, ...models[modelType] }] : [];
      }
    
      if (datasetName) {
        result = result.filter(model => model.supported_datasets.includes(datasetName));
      }
    
      return {
        content: [
          {
            type: 'text',
            text: `Available OpenXAI models${datasetName ? ` for dataset '${datasetName}'` : ''}:\n\n` +
                  JSON.stringify(result, null, 2)
          }
        ]
      };
    }
  • Input schema definition for the list_models tool, specifying optional parameters dataset_name and model_type with enums.
    inputSchema: {
      type: 'object',
      properties: {
        dataset_name: {
          type: 'string',
          description: 'Filter models by dataset they were trained on'
        },
        model_type: {
          type: 'string',
          description: 'Filter by model type (ann, lr, rf, etc.)',
          enum: ['ann', 'lr', 'rf', 'svm', 'xgb', 'all']
        }
      },
      required: []
    }
  • index.js:72-90 (registration)
    Registration of the list_models tool in the MCP server's tools list, including name, description, and schema.
    {
      name: 'list_models',
      description: 'List available pre-trained models in OpenXAI',
      inputSchema: {
        type: 'object',
        properties: {
          dataset_name: {
            type: 'string',
            description: 'Filter models by dataset they were trained on'
          },
          model_type: {
            type: 'string',
            description: 'Filter by model type (ann, lr, rf, etc.)',
            enum: ['ann', 'lr', 'rf', 'svm', 'xgb', 'all']
          }
        },
        required: []
      }
    },
  • index.js:261-263 (registration)
    Dispatch case in the CallToolRequestSchema handler that routes list_models calls to the listModels method.
    case 'list_models':
      return await this.listModels(args.dataset_name, args.model_type || 'all');
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what the tool does but doesn't describe any behavioral traits: no information about pagination, rate limits, authentication requirements, response format, or whether this is a read-only operation. For a listing tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 states the core purpose without any wasted words. It's appropriately sized for a simple listing operation and front-loads the essential information. Every word earns its place in this concise formulation.

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?

For a simple listing tool with 2 optional parameters and 100% schema coverage, the description provides the minimum viable information about what the tool does. However, with no annotations and no output schema, the description doesn't address behavioral aspects or return values. It's adequate for basic understanding but leaves gaps in operational context that would help an agent use the tool effectively.

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 fully documents both parameters with descriptions and an enum for model_type. The description adds no parameter information beyond what's in the schema - it doesn't explain what 'pre-trained models' means in context or provide additional semantic context. Baseline 3 is appropriate when the schema does all the parameter documentation work.

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 action ('List') and resource ('available pre-trained models in OpenXAI'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'list_datasets', 'list_explainers', or 'list_metrics', which all follow the same 'list [resource]' pattern without indicating what distinguishes model listing from other listing operations.

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. There's no mention of prerequisites, when to choose this over other listing tools (like list_datasets), or any context about OpenXAI that would help an agent determine appropriate usage scenarios. The agent must infer usage from the tool name alone.

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