Skip to main content
Glama

list_available_models

Discover available AI models for image generation, text-to-video, or image-to-video tasks, filtered by category, on the FAL Image/Video MCP Server.

Instructions

List all available models in the current registry with their capabilities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter models by categoryall

Implementation Reference

  • The primary handler function that implements the logic for the 'list_available_models' tool. It filters models from the registry based on the input category (or 'all'), maps them to a response format, and returns a JSON-formatted text content block listing the models.
    private async handleListModels(args: any) { const { category = 'all' } = args; let modelsToList: any[] = []; if (category === 'all') { modelsToList = getAllModels(); } else if (category === 'imageGeneration') { modelsToList = MODEL_REGISTRY.imageGeneration; } else if (category === 'imageGeneration') { modelsToList = MODEL_REGISTRY.imageGeneration; } else if (category === 'textToVideo') { modelsToList = MODEL_REGISTRY.textToVideo; } else if (category === 'imageToVideo') { modelsToList = MODEL_REGISTRY.imageToVideo; } const modelList = modelsToList.map(model => ({ id: model.id, name: model.name, description: model.description, endpoint: model.endpoint, category: MODEL_REGISTRY.imageGeneration.includes(model as any) ? 'imageGeneration' : MODEL_REGISTRY.textToVideo.includes(model as any) ? 'textToVideo' : MODEL_REGISTRY.imageToVideo.includes(model as any) ? 'imageToVideo' : 'unknown' })); return { content: [ { type: 'text', text: JSON.stringify({ total_models: modelList.length, category_filter: category, models: modelList, note: "Use 'execute_custom_model' to run any FAL endpoint not in this registry" }, null, 2), }, ], }; }
  • Defines the tool schema for 'list_available_models' including name, description, and inputSchema with optional category parameter.
    tools.push({ name: 'list_available_models', description: 'List all available models in the current registry with their capabilities', inputSchema: { type: 'object', properties: { category: { type: 'string', enum: ['all', 'imageGeneration', 'textToVideo', 'imageToVideo'], default: 'all', description: 'Filter models by category' } }, required: [] } });
  • src/index.ts:460-465 (registration)
    Within the MCP CallToolRequestSchema handler, registers and dispatches 'list_available_models' tool calls to the handleListModels function.
    // Handle special tools first if (name === 'list_available_models') { return await this.handleListModels(args); } else if (name === 'execute_custom_model') { return await this.handleCustomModel(args); }
  • Duplicate tool schema definition for 'list_available_models' in the HTTP direct tools/list handler.
    tools.push({ name: 'list_available_models', description: 'List all available models in the current registry with their capabilities', inputSchema: { type: 'object', properties: { category: { type: 'string', enum: ['all', 'imageGeneration', 'textToVideo', 'imageToVideo'], default: 'all', description: 'Filter models by category' } }, required: [] } });
  • src/index.ts:1050-1053 (registration)
    Within the HTTP direct tools/call handler, registers and dispatches 'list_available_models' tool calls to the handleListModels function.
    // Handle special tools first if (name === 'list_available_models') { toolResult = await this.handleListModels(args); } else if (name === 'execute_custom_model') {

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/RamboRogers/fal-image-video-mcp'

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