Skip to main content
Glama

Edit an image

edit_image

Modify an existing image or create a new one from reference images with a Kunavo image-edit model, returning a result URL or task ID for tracking.

Instructions

Change an existing image, or make a new one from reference images, with a Kunavo image-edit model (endpoint image_edit in list_models). Spends the balance: one image is charged. What was charged is what get_usage reports. Returns the result's URL when it is ready within wait_seconds, otherwise a task id to follow with get_task. Sending it twice makes and charges two images, unless the second call carries the first one's idempotency_key.

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

Input Schema

NameRequiredDescriptionDefault
maskNoOptional mask: an image of the source's dimensions that marks the part to change. Needs a model with the inpainting capability, and such a model may refuse an edit that brings none. An https:// URL, or the path of a local PNG, JPEG, WebP or GIF file (25 MB at most), which is uploaded for you.
sizeNoShape of the image: a size such as "1536x1024" or a ratio such as "16:9", which the API turns into a shape the model takes; square when left out. An edit model that keeps its source's shape does not read it.
modelYesA model id from list_models with endpoint image_edit.
imagesYesThe source image first, then any further reference images. More than one needs a model with the multi-image-input capability, and no more than its max_input_images in list_models. Each: An https:// URL, or the path of a local PNG, JPEG, WebP or GIF file (25 MB at most), which is uploaded for you.
promptYesWhat to change, or what to make from the images.
resolutionNoResolution tier on a model priced by resolution: one of the ids list_models gives under `tiers`, e.g. "2K". It sets the price. A resolution for a model priced by render speed is refused before anything is sent, and a value that is none of the model's tiers by the API, with a 400 that lists them; neither is charged.
wait_secondsNoHow long to wait for the result before returning, in seconds (0 to 45, default 40). An unfinished task is returned with its id.
idempotency_keyNoAny string of your own, 128 characters at most. Calling again with the same one and the same arguments returns the task that call started instead of starting, and charging, another. A key stands for one request for as long as the API keeps its task: the API refuses it for a request on another tool, for another model or with other arguments, so use a new one for each new request. When left out, one is made and given back in the answer.
rendering_speedNoRender-speed tier on a model priced by it: one of the ids list_models gives under `tiers`, e.g. "TURBO". It sets the price, like resolution.

Output Schema

NameRequiredDescriptionDefault
idYesTask id: img_… (image), vid_… (video) or msc_… (music).
kindYes
urlsYesResult files once completed: the images, the video, or the audio of each track.
errorYes
modelYes
statusYesqueued, in_progress, completed or failed. Anything else is a task that is not finished.
tracksNoMusic only: one entry for each track.
stalledYestrue when the task has gone longer than expected without finishing.
archivedYestrue: every URL in `urls` is Kunavo's own copy and does not expire. false: a file could not be archived and its URL is the model provider's temporary one. null until completed.
next_stepYesWhat to do with this result.
created_atYes
resolutionNoVideo only.
completed_atYes
pollable_untilYesThe task can be read with get_task at least until then.
idempotency_keyNoThe key this task was started under, in the answer of the tool that started it (get_task does not know it). Calling that tool again with it and the same arguments returns this task.
duration_secondsNoVideo only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

Discloses cost behavior ('Spends the balance: one image is charged', get_usage reconciles it), the sync-vs-async return contract tied to wait_seconds, and the billing hazard of double-sending with the idempotency_key remedy. This is consistent with and goes well beyond the annotations (readOnlyHint=false, idempotentHint=false, destructiveHint=false).

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?

Four sentences ordered by importance: purpose, cost, return shape, retry safety. Dense but every sentence carries distinct information; the idempotency sentence is long but justified by the money at stake.

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?

For a 9-parameter paid mutation with full schema descriptions, an output schema and annotations, the description supplies exactly the missing operational context: billing, sync/async behavior, and safe retries. Nothing an agent needs before calling is absent.

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 the economic consequence of idempotency_key (a retry without it makes and charges a second image) which the schema alone frames as a mere dedupe key. wait_seconds is also tied to the resulting return shape.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Change an existing image, or make a new one from reference images') and pins it to a model class via 'endpoint image_edit in list_models'. It does not explicitly contrast with the sibling generate_image, so the boundary for text-only generation is left to inference.

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?

Gives clear triggering conditions: use it to change an existing image or build one from reference images, and it notes the model must carry the image_edit endpoint. It explains the wait-then-task-id pattern, but names no alternative sibling for the pure generation case.

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