Skip to main content
Glama

Generate image

generate_image

Create raster images from text prompts on your ChatGPT plan with no API key. Save full-resolution files locally and get previews, transparent backgrounds, and aspect ratio control.

Instructions

Generate a new raster image (photo, illustration, texture, sprite, mockup, icon, product shot…) from a text prompt, using the user's ChatGPT plan — the same image service as OpenAI Codex's built-in image tool, no API key. Saves the full-resolution file and returns its path plus a preview. The service chooses resolution and quality; steer orientation with aspect_ratio or in the prompt. Use background="transparent" for assets that need real alpha. Typically takes 15-60 s.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoNumber of variants of this same prompt, 1-4 (default 1). Each variant is a separate request against the user's ChatGPT image quota. For several different assets make one call per asset instead.
promptYesFull image description. Structure it: use case, subject, style/medium, composition, lighting, palette, exact text in quotes, constraints/avoid.
overwriteNoReplace an existing file at output_path (default false).
backgroundNoBackground: "transparent" returns a PNG with a real alpha channel (cutouts, sprites, icons, stickers, logos); "opaque" asks for a filled background (a hint — also describe the backdrop in the prompt); "auto" (default) lets the service decide.auto
output_pathNoWhere to save: a .png/.jpg/.jpeg file path or a directory, absolute or relative to the workspace root. Omit to save in the server's image library (outside the project). Existing files are never replaced unless overwrite=true (a -2, -3… sibling is used instead); with n>1 a -1, -2… suffix is added.
aspect_ratioNoCanvas shape: auto (default), 1:1, 4:5, 5:4, 4:3, 3:4, 3:2, 2:3, 16:9, 9:16, 21:9 or 9:21. The service chooses the exact pixel size from the prompt; this adds an explicit aspect-ratio line to it.auto
output_formatNoFile format: png (default) or jpeg (converted locally; cannot be transparent). Inferred from output_path's extension when given.
include_previewNoAttach a downscaled preview so you can check the result visually (default true). Set false to save tokens.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
imagesYesSaved images (full resolution).
promptYesThe exact prompt sent to the image service.
failuresYesErrors for variants that failed (partial success).
warningsYes
elapsed_msYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description discloses important behaviors: it saves the full-resolution file, returns a path plus preview, lets the service choose resolution and quality, typically takes 15-60 seconds, and requires no API key while using the user's ChatGPT plan. It also notes that the service controls resolution, which is useful operational context and contradicts nothing in the 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 tight sentences with no filler. It front-loads the core purpose, then adds useful behavioral and usage details (output, resolution control, alpha guidance, expected latency) in order of importance.

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?

Given the rich input schema, output schema, and annotations, the description is complete enough for an agent to invoke the tool correctly. It covers what the tool creates, how the result is returned, how to control key parameters, quota/cost context, and expected runtime. No critical call-related detail is missing.

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?

Schema coverage is 100% and each parameter already has rich descriptions, so the baseline is 3. The description adds extra meaning by explaining when transparent backgrounds are appropriate, how aspect_ratio can steer orientation, and that multiple variants count against quota. That additional context lifts it above baseline, though the schema already does most of the work.

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 states a specific verb ('Generate') and resource ('new raster image'), enumerates concrete use cases (photo, illustration, texture, sprite, mockup, icon, product shot), and emphasizes that it creates a new asset rather than editing one. This makes it clearly distinct from the sibling edit_image and remove_background tools.

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 context for when to use the tool: to create raster images from a text prompt and save them with a preview. It also gives targeted guidance such as using background="transparent" for assets needing alpha and steering orientation with aspect_ratio. However, it never explicitly contrasts with edit_image or remove_background or states when not to use it, so it stops short of a 5.

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