Skip to main content
Glama

getModelInfo

Retrieve schema details and statistics for a specific statistical model to understand its structure and performance metrics.

Instructions

Retrieve detailed schema and statistics for a specific statistical model

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel name

Implementation Reference

  • Core handler function that implements the getModelInfo tool logic. Retrieves the model schema from storage and formats the response with name, title, description, properties, and required fields.
    async getModelInfo(args) { const { model } = args; const schema = await this.storage.getModel(config.storage.defaultDatabase, model); if (!schema) { throw new Error(`Model '${model}' not found`); } return { name: model, title: schema.title, description: schema.description, properties: schema.properties, required: schema.required || [] }; }
  • Input schema validation for getModelInfo tool, defining the required 'model' string parameter.
    inputSchema: { type: 'object', properties: { model: { type: 'string', description: 'Model name' } }, required: ['model'] }
  • Registration of the getModelInfo tool in the server's tools array, including name, description, and schema.
    { name: 'getModelInfo', description: 'Get detailed information about a model', inputSchema: { type: 'object', properties: { model: { type: 'string', description: 'Model name' } }, required: ['model'] } }
  • Dispatch registration in the handleToolCall switch statement that calls the getModelInfo handler.
    case 'getModelInfo': result = await this.getModelInfo(args); break;
  • Alternative handler implementation in index.js using MCP SDK style, similar logic but returns text content with JSON schema.
    case 'getModelInfo': // Check filesystem first let modelInfo = models.get(args.model); if (!modelInfo) { try { modelInfo = await storage.getModel(config.storage.defaultDatabase, args.model); if (modelInfo) { models.set(args.model, modelInfo); } } catch (error) { throw new Error(`Model '${args.model}' not found`); } } if (!modelInfo) { throw new Error(`Model '${args.model}' not found`); } return { content: [{ type: 'text', text: `Model: ${args.model}\n\nSchema:\n${JSON.stringify(modelInfo, null, 2)}` }] };

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/smallmindsco/MongTap'

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