MCP/Tools/Images/edit_image
edit_image

Edit an existing image with an instruction

Low cost

Apply a natural-language instruction to an existing image — swap headlines, change colors, remove text, replace backgrounds — without regenerating the whole composition.

How it works

Pass an instruction plus a base image (from your media library by imageId, by URL, or as raw base64). The tool feeds the original as a style reference to Claivra's image model, anchored on the original composition, framing, and identity. Use it for surgical changes — 'remove the LOS ANGELES headline,' 'swap the car for a black Tesla,' 'change the CTA color to red.' Saves an edit-pair record so you can audit the before/after in your editor history.

Inputs

Name
Type
Required
Description
instruction
string
required
What to change about the image — written as a directive.
baseImageId
string
optional
Image ID from list_media or generate_image.
baseImageUrl
string
optional
Public URL of the image to edit.
baseImage
{ data, mimeType }
optional
Raw base64 of the image.
aspectRatio
string
optional
Output ratio — default 1:1.
model
'claivra-v1' | 'claivra-v2'
optional
Default v1 since this is high-volume editing.
label
string
optional
Short label for the edit history.

Returns

{ editId, imageId, imageUrl, mimeType, model, creditsUsed }

Examples

Strip a location headline from a client ad

Client wants the same ad without the city name — surgical edit, original composition preserved, no re-generation cost spike.

{
  "instruction": "Remove the 'LOS ANGELES' headline entirely. Replace the city skyline in the background with a generic dark night cityscape. Keep cars, lighting, CTA pixel-identical.",
  "baseImageUrl": "https://cdn.claivra.com/file/claivra/.../edited/mcp-edit-1779016048391_0.jpeg",
  "aspectRatio": "1:1"
}