Skip to main content
Glama

Continue Edit Session

continue_edit_session

Apply a new edit to the last generated image in a session, using a short focused prompt to refine details while preserving the rest of the image.

Instructions

Apply another edit turn to an existing session. The previous turn's output image is used as the input. Use short, focused prompts like "make the sky more orange" or "add a small boat on the horizon"; include "keep everything else the same" to limit drift. Returns the new image and the updated session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeNoOutput dimensions. "auto" (default), one of the presets "1024x1024", "1536x1024", "1024x1536", or a custom "WxH" where both edges are multiples of 16, max edge ≤ 3840px, aspect ratio within 1:3–3:1, and total pixels 655,360–8,294,400. Outputs above 2K are beta.auto
userNoOptional end-user identifier forwarded to OpenAI for abuse monitoring. Pass a stable hashed user ID, not PII.
modelNoModel to use. One of "gpt-image-2", "gpt-image-2.5-flare", "gpt-image-2.5-sunburst"; defaults to "gpt-image-2". The 2.5 variants accept the same parameters. Cost/token estimates assume gpt-image-2 pricing.
promptYesImage description. gpt-image-2 handles very detailed prompts; use ALL CAPS or quote literal text you want rendered verbatim.
qualityNoEdit quality — same levels as generate.auto
backgroundNoBackground behavior. "opaque" forces a filled background; "auto" lets the model pick. gpt-image-2 does NOT support transparent backgrounds — use a different model for that.auto
session_idYesThe session id returned by start_edit_session.
output_formatNoFile format. "png" (default, lossless), "jpeg" (smaller, lossy), "webp" (best compression). When omitted on continue_edit_session, the session's current format is kept.
filename_prefixNoShort label appended to the generated filename so you can find it later (e.g. "hero-banner"). Letters/digits/hyphens only; auto-sanitized.
output_compressionNoCompression level 0–100 for jpeg/webp outputs. Ignored for png. Defaults to 100 (minimal compression).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
turnYes
modelYes
notesNoCaveats about how the request was served.
routeNoWhich API route served the request (edit tools only): "direct" = /v1/images/edits, "responses" = Responses-API fallback (one image per call, undercounted cost).
usageYes
imagesYes
promptYes
appliedYes
requestedYes
session_idYes
cost_usd_estimatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.5/5.0
Behavior4/5

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

With annotations only providing readOnlyHint=false, idempotentHint=false, and openWorldHint=true, the description adds valuable behavioral context: the chaining behavior ('previous turn's output image is used as the input') and the drift-reduction effect of 'keep everything else the same'. It also states what is returned. No contradiction with the annotations was found.

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?

Three sentences, no filler, and the core purpose is front-loaded. The prompt guidance and return-value note are both useful and compact. Every sentence earns its place.

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?

The tool is complex (10 parameters, output schema, sibling session tools), but the description covers purpose, chaining behavior, prompt strategy, and return value. The input schema documents all parameters, the output schema covers results, and annotations cover safety traits. No critical gap remains for an agent to call this correctly.

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%, so the baseline is 3, but the description adds meaningful guidance beyond the schema for the prompt parameter: use short, focused iterative prompts and optionally include 'keep everything else the same' to limit drift. This is practical parameter-level advice that the schema's generic prompt text does not provide.

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 action ('Apply another edit turn to an existing session') and a clear resource ('session'), while also noting that the previous turn's output becomes the next input. The phrase 'another edit turn' and 'existing session' distinguishes it from start_edit_session and edit_image without needing to reference them explicitly.

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?

The description conveys clear context: use this tool for subsequent turns of an existing edit session, after start_edit_session has created it. It also gives actionable prompt-engineering guidance ('short, focused prompts', 'keep everything else the same') to reduce drift. It does not explicitly name sibling tools or state when not to use it, so it falls just 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.