list_models
Browse and filter pre-trained AI models by dataset or type using OpenXAI MCP Server. Simplify selection for evaluating and benchmarking explanation methods.
Instructions
List available pre-trained models in OpenXAI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_name | No | Filter models by dataset they were trained on | |
| model_type | No | Filter by model type (ann, lr, rf, etc.) |
Implementation Reference
- index.js:466-523 (handler)The handler function that implements the core logic of the 'list_models' tool. It defines available models (ANN, LR, RF, SVM, XGBoost), filters them by dataset_name and model_type parameters, and returns a formatted text response with the list of models.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) } ] }; }
- index.js:72-90 (schema)The tool schema definition including name, description, and inputSchema specification for the 'list_models' tool, registered in the ListToolsRequestSchema handler.{ 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-262 (registration)The dispatch/registration in the CallToolRequestSchema switch statement that maps 'list_models' tool calls to the listModels handler method.case 'list_models': return await this.listModels(args.dataset_name, args.model_type || 'all');