listImageModels
Discover available image generation models to select the right one for your creative projects through the MCPollinations Multimodal MCP Server.
Instructions
List available image models
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/imageService.js:521-534 (handler)The core handler function that fetches the list of available image models from the Pollinations API endpoint and returns the JSON response.export async function listImageModels() { try { const response = await fetch('https://image.pollinations.ai/models'); if (!response.ok) { throw new Error(`Failed to list models: ${response.statusText}`); } return await response.json(); } catch (error) { log('Error listing image models:', error); throw error; } }
- src/services/imageSchema.js:104-111 (schema)The JSON schema definition for the listImageModels tool, specifying no required input parameters.export const listImageModelsSchema = { name: 'listImageModels', description: 'List available image models', inputSchema: { type: 'object', properties: {} } };
- pollinations-mcp-server.js:297-312 (registration)MCP server request handler that registers and dispatches tool calls to the listImageModels handler function.} else if (name === 'listImageModels') { try { const result = await listImageModels(); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } catch (error) { return { content: [ { type: 'text', text: `Error listing image models: ${error.message}` } ], isError: true }; }
- src/schemas.js:32-44 (schema)Central function that collects and returns all tool schemas, including listImageModelsSchema, for MCP listTools requests.export function getAllToolSchemas() { return [ generateImageUrlSchema, generateImageSchema, editImageSchema, generateImageFromReferenceSchema, listImageModelsSchema, respondAudioSchema, listAudioVoicesSchema, respondTextSchema, listTextModelsSchema ]; }
- pollinations-mcp-server.js:198-200 (registration)MCP server registration for ListToolsRequestSchema, which provides the tool schema for listImageModels via getAllToolSchemas().server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getAllToolSchemas() }));