Skip to main content
Glama

Edit an existing image with AI

edit_image
Destructive

Edit an image you already have: change the background, add or remove an object, restyle it, make a variation. Pass the image URL in baseImageUrl and what to change in prompt. Returns a durable public URL ready to pass to create_post. Synchronous. Costs 20 AI credits per image (40 when reference images are attached), the same as generate_image. For a new image from text, or an edit that also needs an aspect ratio, product photos or characters, use generate_image. Nothing is charged if it fails. SPENDS AI CREDITS ONLY WITH confirm: true. Call it first without confirm: nothing runs and nothing is charged, you get the quote (what it will do and the credits). Tell the user, in your own words, exactly that — including the options you chose, so they can change them — and wait for a clear yes before calling again with the same arguments and confirm: true. One yes covers the plan they approved (e.g. every line of an approved voice-over with the chosen voice); anything new or different needs a new yes.

Input Schema

NameRequiredDescriptionDefault
promptYesWhat to change, in detail. Describe the result you want, not the steps: "same product on a marble surface, soft daylight from the left".
confirmNotrue ONLY after the user said yes to the quote (what it does and the credits). Without it nothing runs and nothing is charged.
workspaceIdNoWorkspace to work on (an id from list_workspaces). Not needed when this connection is tied to one workspace, or when you pass an account: the account's workspace is used.
baseImageUrlYesPublic https URL of the image to edit. Use list_library_media or list_account_media to find one.
reservationIdNoOptional. A credit reservation (from an approved production) to pay this image from, instead of the monthly pool.
idempotencyKeyNoOptional. A unique id for this action (16-128 chars: letters, digits, _ : . -). If you are unsure whether a call went through (timeout, network error), repeat it with the SAME idempotencyKey and the same arguments: you get the original result and nothing is done twice.

Output Schema

NameRequiredDescriptionDefault
urlNoDurable public URL of the edited image.
quotaUsedNo
quotaLimitNo
confirmTokenNo
estimatedCreditsNo
needsConfirmationNotrue = this is only the quote: nothing was done or charged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedOutput schema / properties / confirmToken
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / estimatedCredits
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / needsConfirmation
      Added value: +{
      +  "description": "true = this is only the quote: nothing was done or charged.",
      +  "type": "boolean"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "url"
      -]
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnly=false, destructive=true, openWorld=true) by disclosing credit cost (20, or 40 with reference images), that nothing is charged on failure, that the call is synchronous, that a durable public URL is returned for create_post, and that without confirm:true nothing runs. It also defines a quote-then-confirm protocol and idempotent retry hint, which annotations cannot express.

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 purpose, then cost, then routing to generate_image, then the confirm protocol — a sensible order. Slightly redundant: the confirm/credit rule is restated ("SPENDS AI CREDITS ONLY WITH confirm: true" followed by a paragraph re-explaining the quote flow), but each sentence carries substantive content.

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?

An output schema exists, yet the description still briefly notes the returned durable URL, which is the key downstream dependency (create_post). With cost, failure behavior, confirmation protocol, and sibling routing all covered, an agent has everything needed to invoke this tool correctly and safely.

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; the description adds real meaning by explaining that baseImageUrl must be an existing image and that prompt describes the desired result rather than steps. Its explanation of confirm semantics (cost gate, quote, approval scope) adds workflow context the schema only hints at.

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 and resource ("Edit an image you already have") and immediately enumerates concrete edit types: background change, add/remove object, restyle, variation. It explicitly distinguishes itself from generate_image, so an agent can route correctly without opening any 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?

Names the alternative (generate_image) and the exact conditions that select it: new image from text, or edits needing aspect ratio, product photos, or characters. It also prescribes the confirm/quote workflow with a clear trigger ("wait for a clear yes") and the scope of a single approval.

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.

Resources