Skip to main content
Glama

Edit a photo

edit_photo
Destructive

Use this to change one of the user's photos while keeping the rest the same: the outfit, colours, background, an object, the expression ("change her top to red", "make it night"). To put a specific item into the photo, pass its picture as image with use "add" and say where it goes in the instruction ("she holds the bottle up next to her face"). To dress the influencer in a specific garment, pass its picture as image with use "wear" and garment_category; the instruction isn't needed. To change the photo's shape (a square photo made 9:16 for stories, a portrait made landscape), pass aspect_ratio; the scene is extended to fill the new frame and the person stays the same. The instruction is optional then, and it can go with any other change; a try-on keeps the shape. Costs 1 credit and makes a new photo; the original is kept. Say the cost before calling. Returns at once with a generation_id; then call get_generation (usually 15 to 40 seconds). Calling it again starts and charges a new edit.

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": {
      "photo_id": "<photo_id>"
    },
    "name": "edit_photo"
  }
}

Input Schema

NameRequiredDescriptionDefault
useNoWhat the image is for: "add" an item to the photo (default) or "wear" a garment.
imageNoAn image: an upload_id from upload_image (for a file the user has), a photo_id of one of the user's photos, or an https:// link to an image. The item to add or the garment to wear.
photo_idYesThe photo to edit: a photo_id from get_generation or list_media.
instructionNoWhat to change, or where the added item goes. Optional when aspect_ratio is the only change.
aspect_ratioNoA new shape for the photo: 9:16 for stories and reels, 3:4 for feed posts, 1:1 square, 16:9 or 4:3 landscape. Leave out to keep its shape.
garment_categoryNoFor use "wear": tops, bottoms, or one-pieces (a dress or jumpsuit).

Output Schema

NameRequiredDescriptionDefault
okNoPresent only on a refusal: the summary says why, and what the user can do.
kindNo
summaryYes
photo_idNoThe new photo.
view_urlNo
error_codeNoPresent only on a refusal.
aspect_ratioNo
credits_leftNo
generation_idNo
credits_chargedNo
source_photo_idNo
expected_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Far beyond the annotations: it discloses cost (1 credit, must be stated to the user before calling), that a new photo is created and the original kept, the async generation_id return, expected latency, and repeat-call billing behavior. The only gap is that destructiveHint=true is not directly explained in terms of what the annotation means, though 'original is kept' effectively resolves the risk question.

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?

Dense but every sentence carries a distinct rule or constraint, and the core purpose is front-loaded. Some sentences are long with parenthetical examples and could be split, but no content is filler.

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 paid, asynchronous, multi-mode edit tool, the description covers cost, billing on repeat, non-destructive output, the polling handoff, and each mode's parameter pairing. With an output schema present, return values need not be explained, so nothing essential is missing.

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 genuine meaning: it ties 'use' values to intent, explains that the image can be an uploaded file, an existing photo_id, or a URL, and describes what aspect_ratio actually does ('the scene is extended to fill the new frame and the person stays the same'). This behavioral meaning for aspect_ratio and the optional-instruction interaction is not in the schema.

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?

Opens with a specific verb and resource ('change one of the user's photos while keeping the rest the same') and immediately scopes it with concrete examples ('change her top to red', 'make it night'). It is clearly distinguishable from siblings like get_generation, which it explicitly names as the follow-up step rather than a substitute.

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 explicit branching rules: use 'add' with a placement instruction, use 'wear' with garment_category and no instruction, use aspect_ratio alone for reshaping. It also states the async follow-up (call get_generation, typically 15-40 seconds) and warns that calling again starts and charges a new edit, which is exactly the when-not guidance an agent needs.

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