Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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; } }
  • 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: {} } };
  • 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 }; }
  • 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 ]; }
  • MCP server registration for ListToolsRequestSchema, which provides the tool schema for listImageModels via getAllToolSchemas().
    server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: getAllToolSchemas() }));

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/pinkpixel-dev/MCPollinations'

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