Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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; } }
  • 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 ]; }
  • 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 }; }

Other Tools

Related Tools

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