listImageModels
Retrieve a list of available image models for AI-assisted content creation, enabling users to select and utilize specific models for image generation tasks.
Instructions
List available image models
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/services/imageService.js:139-156 (handler)The handler function for the listImageModels tool. It constructs the API URL for models, fetches the JSON list from Pollinations API, and returns it formatted as an MCP text content response.async function listImageModels(params) { try { const url = buildUrl(IMAGE_API_BASE_URL, "models"); const response = await fetch(url); if (!response.ok) { throw new Error(`Failed to list models: ${response.statusText}`); } const models = await response.json(); // Return the response in MCP format return createMCPResponse([createTextContent(models, true)]); } catch (error) { console.error("Error listing image models:", error); throw error; } }
- src/services/imageService.js:226-226 (registration)The registration entry for the listImageModels tool within the imageTools export array. Includes tool name, description, empty input schema object, and reference to the handler function.["listImageModels", "List available image models", {}, listImageModels],
- src/index.js:24-24 (registration)Spreads the imageTools array (containing listImageModels registration) into the main toolDefinitions array, which is later used to register all tools with the MCP server via server.tool() calls....imageTools,