Skip to main content
Glama

generate_image

Generate images from text prompts and save them to disk. Create UI mockups, icons, diagrams, illustrations, or marketing graphics with in-image text.

Instructions

Generate image(s) from a text prompt with OpenAI GPT Image and save them to disk.

Use this to create new images from scratch: UI mockups, icons, hero images, diagrams, illustrations, and social/marketing graphics. GPT Image renders in-image text unusually well, so write any text you want to appear in the image literally and describe its placement.

Args: prompt: What to generate. Be specific about subject, style, composition, lighting, and any text that should appear in the image. model: GPT Image model. Default "gpt-image-2" (best quality + reasoning). Use "gpt-image-1-mini" for cheap/fast iteration, then re-render the final asset with "gpt-image-2". size: "1024x1024" (square), "1536x1024" (landscape), "1024x1536" (portrait), or "auto". gpt-image-2 also supports larger / 2K sizes. quality: "low", "medium", "high", or "auto". Higher is better and costs more. n: Number of images to generate (1-10). background: "auto", "opaque", or "transparent". NOTE: gpt-image-2 does NOT support "transparent" — pass model="gpt-image-1.5" (or another alpha-capable model) when you need a transparent background. output_format: "png", "jpeg", or "webp". output_dir: Directory to save images into. Defaults to $IMAGE_OUTPUT_DIR, or ./generated-images relative to the current working directory. filename: Base filename without extension. Defaults to a slug of the prompt plus a timestamp.

Returns: A text summary with the saved file path(s), followed by the image(s) inline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
sizeNo1024x1024
modelNogpt-image-2
promptYes
qualityNohigh
filenameNo
backgroundNoauto
output_dirNo
output_formatNopng
Behavior5/5

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

With no annotations, the description fully explains behavior: saves to disk, returns a text summary plus inline images, and warns that gpt-image-2 does not support transparent backgrounds while recommending an alternative model. It also clarifies default directories and filename behavior.

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 well-organized with Args and Returns sections, front-loads the core purpose, and every sentence adds useful information. Despite its length, it is dense with practical guidance and avoids filler.

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?

For a complex tool with 9 parameters, no annotations, and no output schema, the description is remarkably complete. It covers all parameters, defaults, model-specific caveats, output behavior, and even prompt-writing tips, making it self-sufficient.

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

Parameters5/5

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

Schema coverage is 0%, so the description must explain all 9 parameters. It does so thoroughly: each arg has meaning, defaults, and often extra guidance (e.g., size options, quality tradeoffs, background caveat, filename default). This goes far beyond the bare types in the schema.

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 'Generate image(s) from a text prompt with OpenAI GPT Image and save them to disk,' which is a specific verb+resource+action. It clearly distinguishes itself from the sibling edit_image by emphasizing creation 'from scratch' and listing concrete use cases like UI mockups and icons.

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?

Explicitly states 'Use this to create new images from scratch' and enumerates example use cases, giving clear context. It does not name edit_image as an alternative for modifications, but the 'from scratch' phrasing strongly implies the boundary.

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/skyjoe66/gpt-image-mcp'

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