Skip to main content
Glama

Generate an image

generate_image

Generate images from text prompts, save them to disk, and receive file paths with inline previews for review.

Instructions

Generate one or more images from a text prompt using OpenAI's GPT Image models, save them to disk, and return the file paths plus an inline preview.

Prompt style: these models follow long, specific prose well. Describe subject, composition, lighting, medium/style, colour palette and mood. Any text that should appear inside the image must be given verbatim in quotes.

Cost control: use quality "low" (or gpt-image-1-mini) while iterating on composition, then re-render the winner at quality "high".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoHow many variations to generate. dall-e-3 supports only 1.
sizeNoImage dimensions as "WIDTHxHEIGHT", or "auto". Common: 1024x1024 (square), 1536x1024 (landscape), 1024x1536 (portrait). gpt-image-2 also accepts larger sizes such as 2048x2048 and 3840x2160 (edges must be multiples of 16, aspect ratio under 3:1).
modelNoImage model id. Omit or pass "auto" to use the best available model (tries gpt-image-2, then falls back if this API key lacks access). Pass an explicit id to control cost/quality: gpt-image-2, gpt-image-1.5, gpt-image-1, gpt-image-1-mini, dall-e-3. Any newer model id is also accepted and passed through unchanged.
styleNodall-e-3 only. Ignored by gpt-image models.
promptYesWhat to draw. Be specific and descriptive; long prompts work well.
qualityNoRender quality. "low" is fast and cheap for drafts, "high" is for final output. Defaults to the model default ("auto").
filenameNoBase filename without extension. Defaults to a timestamp plus a slug of the prompt. With n > 1 an index is appended.
backgroundNoUse "transparent" for logos, icons, stickers and cut-outs. Requires output_format png or webp. Not supported by dall-e-3.
moderationNoContent-filter strictness for gpt-image models. Defaults to "auto".
output_dirNoDirectory to write the images into. Pass an absolute path (e.g. the current project's assets folder) when the images belong to a project. Defaults to /root/Pictures/claude-images.
output_formatNoFile format. png (default) for graphics/transparency, jpeg/webp for photos.
return_previewNoReturn a downscaled copy of each image inline so you can actually look at the result and iterate. Set false to save tokens when the image is not going to be reviewed.
output_compressionNoCompression level 0-100 for jpeg/webp output.
Behavior4/5

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

With no annotations present, the description carries the burden of disclosing side effects and behavior. It clearly states that images are saved to disk and that the tool returns file paths plus an inline preview. It also reveals model behavior around prompt-following quality. It does not disclose potential rate limits or authentication needs, but the core effects are transparent.

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 three tight paragraphs with no filler. The first sentence front-loads the tool's core purpose and side effects, while the subsequent paragraphs add targeted, non-redundant guidance on prompt style and cost control. Every sentence contributes actionable information.

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 tool's complexity (13 parameters, no output schema), the description covers the essential operational flow: generate, save, preview, and iterate. It also states return values, which matters because there is no output schema. It does not mention defaults like the output directory or naming convention, but these are well documented in the schema, so the description is sufficiently complete for correct tool selection and invocation.

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?

The input schema already has 100% coverage for all 13 parameters, so the baseline is 3. The description adds real value beyond the schema by teaching prompt-authoring strategy (subject, composition, lighting, palette, mood, quoted text) and by mapping quality choices to iteration phases. This moves it well above baseline.

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 concrete, multi-part action: generate one or more images from a text prompt, save them to disk, and return file paths plus an inline preview. It names the model family (OpenAI GPT Image models) and clearly distinguishes the behavior from sibling tools like edit_image and list_image_models.

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?

It provides clear practical guidance on how to use the tool effectively: write long, specific prose describing subject, composition, lighting, and mood, and quote in-image text verbatim. It also gives a cost-control workflow (use low quality while iterating, high quality for the final render). It does not explicitly say 'use this instead of edit_image,' but the generation-focused context is clear.

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/ChristophLabestin/image-generator-mcp'

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