Skip to main content
Glama

edit_image

Revise an existing image or combine several references to apply follow-up changes, saving each result as a new numbered version while keeping earlier versions available.

Instructions

Revises an existing image, or combines several as references, and saves the result.

This is the tool for follow-up changes ("make it black", "add sunglasses", "remove the
background"): pass the saved path of the latest version from the previous result. The
result is saved as the next numbered version, so earlier versions stay available.

Args:
    prompt: The change to make, and what must stay the same, for example "Make the cat's
        fur black. Keep the pose, background, and lighting unchanged." For several
        references, describe the new image to build from them.
    image_paths: Full paths to one or more local PNG, JPEG, or WebP files. For a revision,
        the single most recent version.
    mask_path: Optional PNG whose transparent areas mark where to edit the first image.
    size: "auto" or WIDTHxHEIGHT, with the same rules as generate_image.
    quality: "low" for fast drafts up to "max".
    background: "transparent" needs output_format "png" or "webp".
    output_format: File format of the saved image.
    n: Number of results, 1 to 4. Each one is billed.
    model: A model ID for this request only. Leave empty to use the user's default.
    open_after: Open each saved image in the user's default image viewer. Set it when the
        user asks to see or open the result, which helps most in Claude Code, where the chat
        is a terminal that can't display images.
    input_fidelity: Leave as "auto". GPT Image 2 and later always preserve input detail and
        reject this option; "high" helps only older models keep faces and fine detail.

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": {
      "prompt": "<prompt>",
      "image_paths": "<image_paths>"
    },
    "name": "edit_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
nNo
sizeNoauto
modelNo
promptYes
qualityNoauto
mask_pathNo
backgroundNoauto
open_afterNo
image_pathsYes
output_formatNopng
input_fidelityNoauto

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does it well: it discloses that edits create a new numbered version rather than overwriting, that each of n results is billed, that GPT Image 2+ rejects input_fidelity, and that open_after helps in terminal-only environments like Claude Code. These are non-obvious behavioral and cost traits an agent could not infer from the schema.

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 purpose and routing rule are front-loaded in the first two sentences, then parameters are laid out in a scannable Args block. Length is proportionate to 11 parameters and no sentence is filler — even the input_fidelity note carries a model-compatibility caveat that prevents a failed call.

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 complex 11-parameter generation tool with no output schema, the description covers versioning, cost, format constraints, and the key gotchas. It stops short of stating exactly what the response contains (e.g., saved paths per result), which the agent must infer from "pass the saved path of the latest version from the previous result."

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it documents all 11 parameters with meaning beyond the schema: image_paths takes full paths to local PNG/JPEG/WebP and should be the single most recent version for a revision; mask_path's transparent areas mark the edit region on the first image; background "transparent" requires png or webp; model applies to this request only; n is billed per result.

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?

"Revises an existing image, or combines several as references, and saves the result" gives a specific verb (revise/combine), resource (image), and outcome (saved as next numbered version). The second sentence positions it against the sibling generate_image by scoping it to follow-up changes, so an agent can route correctly without opening either schema.

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 explicitly says this is the tool for follow-up changes and gives concrete triggers ("make it black", "add sunglasses"), plus instructions to pass the latest saved path. Per-parameter guidance covers when to set open_after and when input_fidelity matters. The only gap is that the alternative for brand-new images (generate_image) is implied rather than named.

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

Deploy Server

Other Tools