list-ai-models
Discover available AI models and their configuration status to select the right provider for your task through the Ultra MCP server interface.
Instructions
List all available AI models and their configuration status
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/handlers/ai-tools.ts:265-296 (handler)The core handler method in AIToolHandlers class that implements the 'list-ai-models' tool logic. It retrieves available models and configured providers from ProviderManager, formats a markdown list with status indicators, and returns the response in MCP format.async handleListModels() { const availableModels = this.providerManager.getAvailableModels(); const configuredProviders = await this.providerManager.getConfiguredProviders(); let response = "## Available AI Models\n\n"; for (const [provider, models] of Object.entries(availableModels)) { const isConfigured = configuredProviders.includes(provider); response += `### ${provider.charAt(0).toUpperCase() + provider.slice(1)} ${isConfigured ? "✅" : "❌"}\n`; if (models.length > 0) { response += models.map(model => `- ${model}`).join("\n"); } else { response += "- Not configured"; } response += "\n\n"; } response += `\n## Default Models\n`; response += `- OpenAI/Azure: gpt-5 (optimized for reasoning)\n`; response += `- Gemini: gemini-2.5-pro (with Google Search enabled)\n`; response += `- Grok: grok-4 (latest xAI model with reasoning support)\n`; return { content: [ { type: "text", text: response, }, ], }; }
- src/server.ts:274-282 (registration)Registers the 'list-ai-models' tool with the MCP server using server.registerTool, providing title, description, empty input schema, and an inline handler that delegates to AIToolHandlers.handleListModels() via getHandlers().// Register list-ai-models tool server.registerTool("list-ai-models", { title: "List AI Models", description: "List all available AI models and their configuration status", inputSchema: {}, }, async () => { const aiHandlers = await getHandlers(); return await aiHandlers.handleListModels(); });
- src/handlers/ai-tools.ts:1487-1493 (schema)Defines the tool schema and metadata for 'list-ai-models' (empty input schema) as part of the getToolDefinitions() method export, likely used for MCP tool discovery.name: "list-ai-models", description: "List all available AI models and their configuration status", inputSchema: { type: "object", properties: {}, }, },
- src/server.ts:195-235 (helper)The getHandlers() function lazily initializes and returns the AIToolHandlers instance, loading configs and ProviderManager, which is called by the tool registration to access handleListModels().async function getHandlers() { if (!handlers) { const { ConfigManager } = require("./config/manager"); const { ProviderManager } = require("./providers/manager"); const { AIToolHandlers } = require("./handlers/ai-tools"); const configManager = new ConfigManager(); // Load config and set environment variables const config = await configManager.getConfig(); if (config.openai?.apiKey) { process.env.OPENAI_API_KEY = config.openai.apiKey; } if (config.openai?.baseURL) { process.env.OPENAI_BASE_URL = config.openai.baseURL; } if (config.google?.apiKey) { process.env.GOOGLE_API_KEY = config.google.apiKey; } if (config.google?.baseURL) { process.env.GOOGLE_BASE_URL = config.google.baseURL; } if (config.azure?.apiKey) { process.env.AZURE_API_KEY = config.azure.apiKey; } if (config.azure?.baseURL) { process.env.AZURE_BASE_URL = config.azure.baseURL; } if (config.xai?.apiKey) { process.env.XAI_API_KEY = config.xai.apiKey; } if (config.xai?.baseURL) { process.env.XAI_BASE_URL = config.xai.baseURL; } providerManager = new ProviderManager(configManager); handlers = new AIToolHandlers(providerManager); } return handlers; }