Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OUTPUT_DIRNoDefault directory for saved images (supports ~ and env vars)
GEMINI_API_KEYNoGoogle Gemini API key for image generation
GOOGLE_API_KEYNoAlias for GEMINI_API_KEY
OPENAI_API_KEYNoOpenAI API key for image generation
DEFAULT_PROVIDERNoDefault provider for image generationauto
IMAGEN_MCP_LOG_DIRNoLog directory override
DEFAULT_GEMINI_SIZENoDefault size for Gemini image generation2K
DEFAULT_OPENAI_SIZENoDefault size for OpenAI image generation1024x1024
ENABLE_GOOGLE_SEARCHNoEnable Google Search grounding for real-time datafalse
IMAGEN_MCP_LOG_LEVELNoLog level (e.g. INFO, DEBUG)
IMAGEN_MCP_LOG_PROMPTSNoLog promptsfalse

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
generate_imageB

Generate an image using the best available provider.

Automatic Provider Selection: The server analyzes your prompt and automatically selects the best provider:

  • OpenAI GPT-Image-1 is auto-selected for:

    • Text-heavy images (menus, posters, infographics)

    • Comics with dialogue or speech bubbles

    • Technical diagrams with labels

    • Marketing materials requiring precise text

  • Gemini Nano Banana Pro is auto-selected for:

    • Photorealistic portraits and headshots

    • Product photography

    • High resolution (4K) output

    • Images using reference images for consistency

    • Real-time data visualization (weather, stocks)

Examples:

  • "Create a menu card for an Italian restaurant" → OpenAI (text rendering)

  • "Professional headshot with studio lighting" → Gemini (photorealism)

  • "Infographic explaining photosynthesis" → OpenAI (diagram + text)

  • "Product shot of perfume floating on water" → Gemini (product photography)

Override Selection: Set provider to 'openai' or 'gemini' to override auto-selection.

Args: params: Image generation parameters including prompt and optional settings.

Returns: Formatted response with image path and metadata.

conversational_imageA

Generate images conversationally with iterative refinement.

USE THIS TOOL when:

  • User gives a vague/incomplete prompt that needs refinement

  • User wants iterative refinement across multiple messages

  • User explicitly asks for guidance or suggestions

Dialogue Modes:

  • "quick": 1-2 questions, fast path

  • "guided": 3-5 questions, balanced (DEFAULT)

  • "explorer": Deep exploration with 6+ questions

  • "skip": Direct generation, no dialogue

Provider Selection: Same auto-selection logic as generate_image. Provider is locked for the duration of a conversation (cannot switch mid-conversation).

Usage Pattern:

  1. Initial: "A cozy coffee shop" → System asks refinement questions

  2. User answers questions

  3. Image generated with refined prompt

  4. Refine: "Add more plants" (with same conversation_id)

  5. Continue refining as needed

Args: params: Conversational image parameters including prompt and dialogue options.

Returns: Either dialogue questions or generated image with metadata.

edit_imageA

Edit an existing image using OpenAI gpt-image-2's /images/edits endpoint.

This is the right tool for:

  • Image-to-image refinement (OpenAI's answer to reference images)

  • Inpainting with a mask (paint over regions while preserving the rest)

  • Sequential/cumulative edits that preserve unchanged pixels

  • Brand-accurate modifications to existing images

Key features of gpt-image-2 editing:

  • input_fidelity='high' (default) keeps unchanged pixels constant — critical for multi-step refinement where each edit should build on the last without drift.

  • Full control over quality, background, output_format, and compression.

  • Supports optional PNG mask (transparent pixels are the edit region).

Typical workflow:

  1. Generate or obtain a base image (path on disk)

  2. Call edit_image with prompt='change the sky to sunset'

  3. Take the output path, call edit_image again with next instruction

  4. Repeat — each step preserves pixels outside the described change

Args: params: Edit parameters including prompt, image_path, and options.

Returns: Formatted response with edited image path and metadata.

list_providersA

List available image generation providers and their capabilities.

Returns a comparison of available providers including:

  • Which providers have API keys configured

  • Best use cases for each provider

  • Feature comparison (text rendering, resolution, etc.)

Use this to understand which provider to choose for your task.

list_conversationsA

List saved image generation conversations.

Returns recent conversations that can be continued for refinement. Each conversation tracks the provider used and generation history.

Args: params: Options for filtering and formatting the list.

Returns: List of conversations with metadata.

list_gemini_modelsA

List available Gemini models that support image generation.

Queries the Gemini API to show which models are available for image generation with your API key. Useful for troubleshooting or choosing alternative models.

Returns: List of available Gemini image models with their capabilities.

estimate_costA

Estimate the cost of generating an image without generating it.

Runs the same provider auto-selection as generate_image (unless you pin a provider) and looks up an approximate price from a local pricing table. Useful for comparing providers/qualities before committing.

The figure is a ballpark — real cost depends on live provider pricing and, for OpenAI, actual image output tokens.

Args: params: Prompt plus optional provider/quality/size/n.

Returns: A formatted cost estimate.

generate_image_batchA

Generate many images concurrently from a list of prompts.

Each item runs through the same auto provider selection as generate_image, bounded by max_concurrency. Per-item failures are isolated — one bad prompt does not fail the whole batch. Returns every result (saved paths plus any per-item errors).

Use this instead of calling generate_image in a loop: 8 prompts that would take ~4 minutes serially complete in roughly one generation's time (subject to max_concurrency and provider rate limits).

Args: params: The batch (items + concurrency + optional default provider).

Returns: A formatted summary of all results.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/michaeljabbour/imagen-mcp'

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