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
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Filter models by category | all |
Implementation Reference
- src/index.ts:677-717 (handler)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), }, ], }; }
- src/index.ts:411-426 (schema)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); }
- src/index.ts:995-1010 (schema)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') {