Skip to main content
Glama

Edit image

editImage

Modify an existing image according to text instructions: supply a source image (URL or base64) and a prompt describing the changes (e.g. "add clouds", "warmer color scheme"), with an optional reference_image for extra style or content guidance. To change only one area, pass a mask (white = change, black = keep, the same size as the image): mask_mode "replace" (default) redraws that area from the prompt, "erase" removes what is there. Without a mask the whole image is re-rendered. Never ask for a transparent background in the prompt: it often comes back as a grey-and-white checkerboard painted into the pixels, which removeBackground cannot remove. A sprite keeps its transparency without being asked (see image_type). The job result is an array of image results, each with a url; request n (1-4) to control the number of edited variations. Provided images are uploaded and validated, and any image larger than 15MB is rejected with HTTP 400. Credits are held when the job is accepted and refunded if it fails or is cancelled; the charge scales with the number of images produced. Use editImage to transform a specific existing image; use createImage to generate from text alone, generateWithStyle to borrow a reference's art style, and removeBackground for the dedicated background-removal case. Pass an optional request_id to tag the results so you can retrieve them later via listGenerations (type image). Async generation job: returns {id, status} - poll getApiJob (job and credit contract: see the server instructions).

Credits: This endpoint consumes 0.5 credits per result; 1 credit per result with a mask.

Input Schema

NameRequiredDescriptionDefault
requestBodyYesPayload for editing an existing image based on text instructions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / requestBody / properties / augment_prompt
      Removed value: -{
      -  "description": "Rewrites your prompt behind the scenes into the form the model works best with. Leave it on (the default). Turning it off does not give you more control - it usually gives worse results. Do not disable it unless you really know what you are doing and have tested your prompts extensively. Default: true.",
      -  "example": true,
      -  "type": "boolean"
      -}
  2. Changed1 schema field changed
    • changedInput schema / properties / requestBody / properties / prompt / description
      Previous value: -"Text description of the changes to make (e.g., \"remove the background\", \"add clouds to the sky\", \"make it darker\", \"change the color scheme to warmer tones\"). Required, except with mask_mode \"erase\". With a mask, describe what should fill the masked area."New value: +"Text description of the changes to make (e.g., \"add clouds to the sky\", \"make it darker\", \"change the color scheme to warmer tones\"). Required, except with mask_mode \"erase\". With a mask, describe what should fill the masked area. Describe only the change, never the background's transparency (\"transparent background\", \"on transparency\", \"transparent padding\"); asking for it often paints a checkerboard into the pixels instead. A sprite keeps its transparent background on its own, and removeBackground is the tool for removing one."
  3. Changed5 schema fields changed
    • addedInput schema / properties / requestBody / properties / mask
      Added value: +{
      +  "description": "Optional URL or base64-encoded PNG that limits the edit to one area of the image. White marks the area to change, black the area to keep. It must be exactly the same width and height as `image`, or the call returns 400. Without a mask the whole image is re-rendered, which can shift colours and details outside the part you meant to change. A masked edit costs more than an unmasked one (see the price).",
      +  "example": "<url> OR data:image/png;base64,...",
      +  "type": "string"
      +}
    • addedInput schema / properties / requestBody / properties / mask_mode
      Added value: +{
      +  "description": "Only with `mask`. \"replace\" (the default) redraws the masked area from `prompt`; \"erase\" removes what is in the masked area and takes no prompt.",
      +  "enum": [
      +    "replace",
      +    "erase"
      +  ],
      +  "example": "replace",
      +  "type": "string"
      +}
    • changedInput schema / properties / requestBody / properties / prompt / description
      Previous value: -"Text description of the changes to make (e.g., \"remove the background\", \"add clouds to the sky\", \"make it darker\", \"change the color scheme to warmer tones\")."New value: +"Text description of the changes to make (e.g., \"remove the background\", \"add clouds to the sky\", \"make it darker\", \"change the color scheme to warmer tones\"). Required, except with mask_mode \"erase\". With a mask, describe what should fill the masked area."
    • changedInput schema / properties / requestBody / properties / reference_image / description
      Previous value: -"Optional URL or base64-encoded reference image for style or content guidance."New value: +"Optional URL or base64-encoded reference image for style or content guidance. Not used with mask_mode \"erase\"."
    • changedInput schema / properties / requestBody / required
      Previous value: -[
      -  "image",
      -  "prompt"
      -]New value: +[
      +  "image"
      +]
  4. Changed1 schema field changed
    • changedInput schema / properties / requestBody / properties / augment_prompt / description
      Previous value: -"Augment the prompt behind the scenes. Disable to have more control. Default: true."New value: +"Rewrites your prompt behind the scenes into the form the model works best with. Leave it on (the default). Turning it off does not give you more control - it usually gives worse results. Do not disable it unless you really know what you are doing and have tested your prompts extensively. Default: true."
  5. Changed1 schema field changed
    • changedInput schema / properties / requestBody / properties / image_type / description
      Previous value: -"What kind of image the source is (e.g. \"sprite\"). Not needed when `image` is the URL of an image you generated on Ludo in the last 30 days, which keeps its own type. Set it when you pass base64 or an external URL, so a sprite is edited as a sprite and keeps its transparent background."New value: +"What kind of image the source is (e.g. \"sprite\"). Not needed when `image` is the URL of an image you generated on Ludo in the last 30 days, which keeps its own type. Set it when the image is an upload or a link from elsewhere, so a sprite is edited as a sprite and keeps its transparent background."
  6. Changed1 schema field changed
    • addedInput schema / properties / requestBody / properties / image_type
      Added value: +{
      +  "description": "What kind of image the source is (e.g. \"sprite\"). Not needed when `image` is the URL of an image you generated on Ludo in the last 30 days, which keeps its own type. Set it when you pass base64 or an external URL, so a sprite is edited as a sprite and keeps its transparent background.",
      +  "enum": [
      +    "generic",
      +    "screenshot",
      +    "art",
      +    "asset",
      +    "sprite",
      +    "sprite-vfx",
      +    "sprite-tiling-horizontal",
      +    "sprite-tiling-vertical",
      +    "icon",
      +    "logo",
      +    "ui_asset",
      +    "fixed_background",
      +    "side_scrolling_background",
      +    "vertical_scrolling_background",
      +    "parallax_layer",
      +    "texture",
      +    "tile",
      +    "item-icon",
      +    "portrait",
      +    "card-art",
      +    "splash",
      +    "3d"
      +  ],
      +  "example": "sprite",
      +  "type": "string"
      +}
  7. Changed1 schema field changed
    • changedInput schema / properties / requestBody / properties / request_id / description
      Previous value: -"Optional client-provided identifier, unique per request. Re-sending the same request_id returns the existing job instead of generating again. Also usable with the results endpoint."New value: +"Optional client-provided identifier, unique per request. Re-sending the same request_id returns the existing job instead of generating again. Also usable as the request_id filter of listGenerations."
  8. Changed4 schema fields changed
    • removedInput schema / properties / requestBody / properties / augment_prompt / default
      Removed value: -true
    • changedInput schema / properties / requestBody / properties / augment_prompt / description
      Previous value: -"Augment the prompt behind the scenes. Disable to have more control."New value: +"Augment the prompt behind the scenes. Disable to have more control. Default: true."
    • removedInput schema / properties / requestBody / properties / n / default
      Removed value: -1
    • changedInput schema / properties / requestBody / properties / n / description
      Previous value: -"Number of edited variations to generate (1-4)."New value: +"Number of edited variations to generate (1-4). Default: 1."
  9. Changed1 schema field changed
    • changedInput schema / properties / requestBody / properties / request_id / description
      Previous value: -"Optional client-provided identifier for this request. Use this to retrieve results later via the results endpoint."New value: +"Optional client-provided identifier, unique per request. Re-sending the same request_id returns the existing job instead of generating again. Also usable with the results endpoint."
  10. Changed1 schema field changed
    • addedInput schema / properties / requestBody / properties / request_id
      Added value: +{
      +  "description": "Optional client-provided identifier for this request. Use this to retrieve results later via the results endpoint.",
      +  "type": "string"
      +}
  11. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare the safety profile (not read-only, not destructive, not idempotent), and the description goes well beyond it: 15MB upload rejection with HTTP 400, credit hold/refund semantics and per-result cost, higher cost with a mask, async {id, status} return followed by getApiJob polling, and the checkerboard-transparency failure mode. These are exactly the operational traits an agent cannot infer from annotations.

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?

Front-loaded with the core action and inputs, then mask behavior, then alternatives, then job/credit mechanics — a sensible order. It is dense rather than bloated, though the transparent-background warning and the credit/mask cost are each stated twice, adding slight redundancy.

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?

With no output schema, the description still supplies the return shape (array of image results each with a url) and the async job envelope {id, status} plus the polling tool. Combined with the cost, size-limit, and mask semantics, nothing an agent needs to call it correctly is missing.

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 100%, so the baseline is 3 and most of what the description says about mask colors, mask_mode, and prompt caveats is already in the schema. It adds some cross-parameter framing (n controls variation count, request_id tags results retrievable via listGenerations, image_type is unnecessary for recent Ludo-generated URLs) but largely restates parameter docs.

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+resource (modify an existing image per text instructions) and immediately names the inputs that define the operation (source image, prompt, optional reference image, optional mask). It also explicitly distinguishes itself from createImage, generateWithStyle, and removeBackground, so an agent can route without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit routing sentence: use editImage to transform a specific existing image, createImage to generate from text, generateWithStyle to borrow a reference's style, removeBackground for background removal. It also states the mask vs. no-mask condition and the replace vs. erase choice, covering when-to-use and when-not.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.