Skip to main content
Glama

listImageModels

List the available image models to discover which models can be used for image generation tasks.

Instructions

List available image models

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler: fetches available image models from https://image.pollinations.ai/models and returns the JSON response.
    /**
     * List available image generation models from Pollinations API
     *
     * @returns {Promise<Object>} - Object containing the list of available image models
     */
    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;
      }
    }
  • Schema definition: defines the tool name 'listImageModels', description, and an empty input schema (no parameters required).
    /**
     * Schema for the listImageModels tool
     */
    export const listImageModelsSchema = {
      name: 'listImageModels',
      description: 'List available image models',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    };
  • MCP server handler: the CallToolRequestSchema handler dispatches 'listImageModels' to call the service function and return the result as JSON text.
    } 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
        };
      }
  • Registration helper: getAllToolSchemas() returns all tool schemas (including listImageModelsSchema) for the ListToolsRequestSchema handler.
    export function getAllToolSchemas() {
      return [
        generateImageUrlSchema,
        generateImageSchema,
        editImageSchema,
        generateImageFromReferenceSchema,
        listImageModelsSchema,
        respondAudioSchema,
        listAudioVoicesSchema,
        respondTextSchema,
        listTextModelsSchema
      ];
    }
  • Re-export: imports listImageModels from imageService.js and re-exports it as part of the public API.
    import { generateImageUrl, generateImage, editImage, generateImageFromReference, listImageModels } from './services/imageService.js';
    import { respondAudio, listAudioVoices } from './services/audioService.js';
    import { respondText, listTextModels } from './services/textService.js';
    
    
    // Export all service functions
    export {
      // Image services
      generateImageUrl,
      generateImage,
      editImage,
      generateImageFromReference,
      listImageModels,
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and the description does not disclose any behavioral traits (e.g., read-only nature, data freshness). However, for a simple list tool, the minimal description is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise at only two words. While no extra detail is included, it effectively conveys the tool's purpose without unnecessary verbosity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of parameters and output schema, the description sufficiently explains the tool's functionality. It could mention the output format, but it's complete enough for the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist; schema coverage is 100%. The description does not need to add parameter info, so it scores at the baseline of 4 for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'List available image models' clearly states the action (list) and resource (available image models), distinguishing it from sibling tools like generateImage or editImage.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, such as mentioning it should be used to discover model options before generating images.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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