Skip to main content
Glama

Edit or extend an existing image

edit_image

Edit images with text instructions: apply whole-image changes, inpaint masked areas, or combine multiple images into one scene.

Instructions

Edit existing image(s) with a text instruction. Covers three jobs:

  1. Whole-image edit - pass one image and describe the change.

  2. Inpainting - pass a mask PNG whose transparent areas mark what to replace; everything else is preserved.

  3. Composition / style reference - pass several images and describe how to combine them (e.g. put the product from image 1 into the scene from image 2).

Input images must be png, jpg or webp. dall-e-3 cannot edit; use a gpt-image model.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
maskNoAbsolute path to a PNG mask with an alpha channel. Transparent pixels are the region the model may repaint; opaque pixels are kept. Must match the first input image's dimensions.
sizeNoOutput dimensions as "WIDTHxHEIGHT", or "auto".
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.
imagesYesAbsolute paths to the input image(s). With more than one, they are treated as references to combine.
promptYesThe edit instruction, or a description of the desired final image.
qualityNoRender quality.
filenameNoBase filename without extension. Defaults to a timestamp plus a slug of the prompt. With n > 1 an index is appended.
backgroundNo
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_formatNo
input_fidelityNoUse "high" to preserve faces, logos and fine detail from the input. Not configurable on gpt-image-2, which is always high fidelity.
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_compressionNo
Behavior4/5

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

With no annotations, the description carries the behavioral burden. It usefully explains mask transparency semantics (transparent areas are repainted, opaque areas preserved), accepted input formats, and a model limitation. It does not explicitly state that original files are left untouched or describe the exact output flow, but the schema's output_dir and return_preview parameters partially cover that.

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 compact and well-structured: a one-sentence summary followed by numbered modes that map directly to input patterns. There is no filler, and the most decision-relevant information is front-loaded.

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?

For a 14-parameter tool with no annotations and no output schema, the description covers the main decision axes: mode selection, image formats, mask usage, and model constraints. Its main gaps are not explicitly routing to generate_image for new images and not describing the output/return behavior, but the rich parameter descriptions fill most of the remaining context.

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 description coverage is 71%, so the baseline is 3, but the description adds meaningful context for the core parameters: prompt+one image means whole edit, prompt+mask means inpainting, and prompt+multiple images means composition. It also adds the file-format restriction and the dall-e-3 constraint, which go beyond the schema.

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 clearly states the tool edits existing image(s) with a text instruction, and enumerates three distinct jobs: whole-image edit, inpainting, and composition/style reference. This differentiates it from sibling tools like generate_image (creating new images) and list_image_models (listing 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?

The description gives concrete when-to-use guidance by mapping each of the three modes to a specific input pattern: one image, image+mask, or multiple images. It also warns that dall-e-3 cannot edit and directs agents to a gpt-image model, but it does not explicitly contrast with generate_image for the from-scratch case.

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