gpt_image_gen
Generate and save images by sending a prompt directly to ChatGPT. Returns file paths and optionally embedded images for analysis.
Instructions
Generate one or more images via ChatGPT image gen and save them to disk.
The prompt is sent directly to ChatGPT — phrase it as an image-generation request and let the prompt itself specify how many images you want.
For running multiple distinct prompts in parallel, use gpt_image_gen_batch instead — it fans out concurrently inside a single MCP call. Issuing two gpt_image_gen calls from one Claude message executes serially because the MCP harness serializes calls to the same server.
Args:
prompt: Full image-gen prompt sent directly to ChatGPT.
filename_prefix: Stem for saved files. Single image saves as <prefix>.<ext>; multiple images get numbered suffixes (<prefix>-1.<ext>, <prefix>-2.<ext>, ...). Defaults to a hash of the prompt.
save_dir: Where to save images. Defaults to <cwd>/generated/ (created if missing).
embed_images: When True, the saved images are returned in the tool response so Claude can analyze them. Set False during long iteration loops to keep context light — paths are still returned.
Returns a list of MCP content blocks: a text summary plus, if embed_images is True, the image blobs.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| filename_prefix | No | ||
| save_dir | No | ||
| embed_images | No |