Skip to main content
Glama

Generate image

generate_image

Generate image files from text prompts using Gemini or OpenAI models, save them to disk, and return absolute paths and model metadata.

Instructions

Generate one or more images from a text prompt using Gemini or OpenAI image models and save them to disk. Returns the absolute saved file path(s) plus provider/model metadata. Strongly prefer passing an absolute output_path inside the current project so the file lands where you can use it. Each image costs real API credits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoNumber of images, 1-4 (default 1). Gemini generates sequentially, so n>1 is slower there.
modelNoOverride the model. Gemini: gemini-3.1-flash-image (default), gemini-3.1-flash-lite-image, gemini-3-pro-image, gemini-2.5-flash-image. OpenAI: gpt-image-2 (default, best quality), gpt-image-1.5, gpt-image-1, gpt-image-1-mini. IMPORTANT: gpt-image-2 cannot do transparent backgrounds; pass gpt-image-1.5 when background transparent is needed.
promptYesWhat to generate. Be specific: subject, style, composition, colors, any text to render.
qualityNoOpenAI only, ignored by Gemini. Use low for cheap drafts.
providerNoOverride the default provider. Call list_capabilities to see what is configured.
backgroundNoOpenAI only, ignored by Gemini. transparent yields alpha PNG/WebP, ideal for logos and icons. Requires gpt-image-1.5 or older: gpt-image-2 does not support it, so transparent calls on gpt-image-2 auto-switch to gpt-image-1.5 (noted in the result). Prefer passing model gpt-image-1.5 explicitly when you need transparency.
image_sizeNoGemini 3.x models only (ignored by OpenAI; gemini-2.5-flash-image is fixed at 1024px). Default 1K.
output_pathNoAbsolute path strongly recommended. Either a full file path (.png/.jpg/.webp) or a directory (a slugified filename is derived from the prompt). If omitted: $IMAGE_GEN_MCP_OUTPUT_DIR, then $CLAUDE_PROJECT_DIR, then the server cwd. The server may be restricted to specific directories; call list_capabilities to see allowedDirs.
aspect_ratioNoGemini and OpenAI gpt-image-2 honor the ratio exactly. Older OpenAI models approximate: landscape -> 1536x1024, portrait -> 1024x1536, 1:1 -> 1024x1024.
return_imageNoDefault false. When true, also returns the FIRST image as an inline MCP image block so you can see it without a Read. Large images can exceed the MCP output token limit; for 2K/4K prefer Read on the saved path.
Behavior5/5

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

The description discloses several behaviors not visible in annotations: real API credit costs, sequential generation slowdown on Gemini for n>1, automatic switch from gpt-image-2 to gpt-image-1.5 for transparent backgrounds, model-specific image size handling, and MCP output token limits for return_image. This goes well beyond the sparse annotations.

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

Conciseness5/5

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

The description is four sentences, each carrying essential info: core function, return value, output_path preference, and cost warning. It is front-loaded with the primary purpose and avoids filler while remaining comprehensive.

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

Completeness5/5

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

With no output schema, the description explains the return format (absolute paths + provider/model metadata). It covers cost, output path fallback chain, allowed directories via list_capabilities, transparency caveats, and return_image token limits — a thorough treatment for a 10-param tool with no output schema.

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

Parameters3/5

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

All 10 parameters already have detailed descriptions in the JSON schema (100% coverage), so the description adds little per-parameter semantics. The only extra guidance is preferring an absolute output_path and noting cost implications, which doesn't elevate beyond the schema-driven baseline of 3.

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 opens with a specific verb+resource: 'Generate one or more images from a text prompt using Gemini or OpenAI image models and save them to disk.' This clearly distinguishes it from sibling edit_image (which edits existing images) and names the underlying providers and model families.

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

Usage Guidelines4/5

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

The description gives explicit usage cues: strongly prefer an absolute output_path, call list_capabilities to see configured providers/allowedDirs, and use low quality for cheap drafts. It doesn't explicitly state when to choose generate_image over edit_image, so it lacks a full when-not-to-use contrast.

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/nuver-labs/image-gen-mcp'

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