Skip to main content
Glama

Edit / iterate images in existing chats

edit_images

Refine existing images in a ChatGPT chat by sending a follow-up prompt, keeping full context of prior results. Use it to adjust backgrounds, poses, or text on generated images.

Instructions

Send a follow-up prompt into existing ChatGPT chats (by chat_id from an earlier result, or a chatgpt.com/c/... URL) to refine the image there — 'make the background darker', 'same character, now running', 'fix the text to say X'. The chat keeps full context of previous images. Several edits (different chats) run in parallel; edits to the same chat run in order.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "edits": "<edits>"
    },
    "name": "edit_images"
  }
}

Input Schema

NameRequiredDescriptionDefault
waitNoWait for the images before returning (default). false = return job ids immediately; collect later with wait_for_jobs.
editsYes
output_dirNoFolder to save images into. Default: /root/.gpt-image-mcp/images
return_imagesNoReturn small JPEG previews inline (~500 tokens each) so you can see the results. Set false to save tokens. Files are always saved.
timeout_secondsNoMax seconds this call blocks (capped at 50s so it never hits client tool timeouts). Unfinished jobs keep running — collect them with wait_for_jobs.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does disclose real behavior: chats retain full context of previous images, and concurrency is per-chat ordered but cross-chat parallel. That ordering guarantee is exactly the kind of non-obvious trait worth stating. It does not cover failure modes, cost, or what is returned when wait=false beyond what the schema already says.

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

Conciseness4/5

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

Three sentences, front-loaded with the core action and immediately followed by the identifier requirement and the concurrency rule. The quoted prompt snippets are illustrative rather than filler. Slightly long but nothing is redundant enough to remove.

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?

No output schema exists, and the description does not state what comes back (saved files plus optional inline previews) — that only appears in the return_images and output_dir schema descriptions. For a five-parameter tool with rich nested items, the description plus 80% schema coverage is nearly sufficient, but the return behavior is a small gap.

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?

Schema description coverage is 80%, so nested parameters like prompt, chat_id, preset, styles, and reference_usage are already well documented inline. The description only adds meaning to the chat reference format and illustrates the kind of prompt used for edits; it adds little for wait, timeout_seconds, or return_images, so the baseline 3 is right.

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?

States a specific verb (send a follow-up prompt) and a specific resource (existing ChatGPT chats identified by chat_id or chatgpt.com/c URL) and clarifies the outcome: refining an existing image with full prior context. The three quoted example prompts make the operation unmistakably an iteration on an existing chat rather than a fresh generation, which is what a sibling like generate_images would do.

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?

Gives clear entry conditions — you need a chat_id from an earlier result or a chat URL — and tells the agent that multiple chats run in parallel while edits to one chat run sequentially, which materially shapes how to batch calls. It never explicitly says when not to use it (e.g. 'for brand-new images use generate_images'), so the alternative is left implicit.

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