listImageModels
Discover available image generation models on the MCPollinations Multimodal MCP Server to facilitate AI-driven image creation without authentication requirements.
Instructions
List available image models
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/imageService.js:521-534 (handler)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)Tool schema defining the name, description, and empty input schema (no parameters required).export const listImageModelsSchema = { name: 'listImageModels', description: 'List available image models', inputSchema: { type: 'object', properties: {} } };
- src/schemas.js:32-44 (registration)Registration of listImageModelsSchema in the aggregated list of all tool schemas provided to MCP's listTools endpoint.export function getAllToolSchemas() { return [ generateImageUrlSchema, generateImageSchema, editImageSchema, generateImageFromReferenceSchema, listImageModelsSchema, respondAudioSchema, listAudioVoicesSchema, respondTextSchema, listTextModelsSchema ]; }
- pollinations-mcp-server.js:297-312 (registration)MCP server implementation of the callTool handler specifically for listImageModels, invoking the core handler and formatting the response.} 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 }; }