Skip to main content
Glama

list_models

Discover available AI models with descriptions and recommended use cases to select the right model for your specific task requirements.

Instructions

List all available AI models with their descriptions and best use cases

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'list_models' MCP tool. It retrieves the list of models from the ConsultationService and returns them formatted as a JSON string in a ToolResponse.
    private handleListModels(): ToolResponse { if (this.config.verboseLogging) { console.error("[MCP] Fetching available models list"); } const models = this.consultationService.listModels(); if (this.config.verboseLogging) { console.error(`[MCP] Found ${models.length} available models`); } return { content: [ { type: "text" as const, text: JSON.stringify(models, null, 2), }, ], }; }
  • Registers the 'list_models' tool in the MCP server, including its name, description, and input schema (no required parameters).
    { name: "list_models", description: "List all available AI models with their descriptions and best use cases", inputSchema: { type: "object", properties: {}, }, },
  • Defines the input schema for the 'list_models' tool, which requires no parameters.
    inputSchema: { type: "object", properties: {}, },
  • Helper method in ConsultationService that fetches and formats the list of available models from ModelSelector, invoked by the tool handler.
    public listModels() { const models = this.modelSelector.getAllModels(); return Object.entries(models).map(([key, model]) => ({ name: key, id: model.id, description: model.description, bestFor: model.bestFor, })); }
  • Dispatch case in the main handleToolCall method that routes 'list_models' tool calls to the specific handler.
    case "list_models": result = this.handleListModels(); break;

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/filipkrayem/ai-consultant-mcp'

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