Skip to main content
Glama

Adjust a photo

photo_edit

Add, change, switch off, reorder or remove the photo's adjustments; everyone watching sees each call land, and each call is one step in the replay (photo_undo takes it back). edits, in order:

  • {add: {op, name?, ...settings, mask?}, at?: n | "top" (default: applied last) | "bottom" | {before: name} | {after: name}}

  • {target: name or id, set: {...settings, mask?, name?}} (a setting set to null goes back to its default; mask: null removes the mask)

  • {target, on: false} switches it off without losing it; on: true brings it back

  • {target, order: as at}; {target, delete: true} Name each adjustment by what it does ("warm-up", "lift-face", "background-blur"). preview: "after" sends the new look back with the call. Choosing a mask (details below): a whole thing (a person, the sky, a car, an eye) is best found by photo_select (subject, sky, or object with a point on it), not guessed with shapes. An irregular area you can trace (a strand of hair, the top edge of fur, a path) is a stroke: {kind: "stroke", points: [[x, y], ...], width, feather}, a soft brush along the points (up to 2000). Parts of something by tone or colour: combine, e.g. {select: {id}, range: {by: "luma", from: 0.6, to: 1}} is the subject's bright parts. Before placing shapes on something small, zoom in with photo_look {view} to read its position, and after, zoom again (with adjustment: name to see the mask) to check the edge. To make something a given colour use colorize (exact colour, texture kept; amount 0.6 to 0.8 looks natural), not a hue rotation. Up to 30 edits a call, 60 adjustments a layer. Layers (bottom to top; the photo is always the bottom, always on, normal and opaque). Adjustments go on the photo unless layer names another: {add: {...}, layer: name}, {target, layer, set}.

  • {layer: {add: {kind, name?, on?, blend?, opacity?, mask?, ...}}, at?: n (1 is just above the photo) | "top" (default) | "bottom" | {before: name} | {after: name}}, where kind is: "adjust" (list?: adjustments applied to everything below; no crop, straighten or turn), "fill" (fill: {color: "#rrggbb"} or {gradient: "linear", x1, y1, x2, y2, stops: [[0, "#000000"], [1, "#ffffff"]]} or {gradient: "radial", cx, cy, r, stops}, or a texture drawn from a seed at any size: {texture: "scatter", count (1 to 5000), color?, size?: [smallest, largest] diameter as fractions of the long side, or one number for the largest (default [0.004, 0.012]), softness? 0..1 (0.6), vary? 0..1 (0.5, how much each dot's strength varies), seed?} for snow, rain spots, dust, bokeh or sparkles (transparent between the dots; blend "screen" for light), or {texture: "noise", scale (feature size, a fraction of the long side), octaves? 1..6 (4), stops? (as a gradient's, default black to white), seed?} for fog, mist, haze or grain (blend "screen" with a black first stop adds only light; mask it to where the fog lies)), "raster" (text and shapes, up to 60 ops: for snow, rain, dust or sparkles use a fill with texture "scatter" instead; content {ops: [...]}, the canvas's own ops (text, rect, circle, ellipse, line, polygon, path, stroke, group; canvas_schema describes them), in a space 1000 units on the picture's long side, the other side in proportion: photo_look says its size. Text uses the canvas's faces, e.g. {k: "text", x: 60, y: 120, text: "Summer", size: 72, font: "display", fill: "#ffffff"}), "photo" (another picture: photo_place adds one; src from one already placed can be used again, with box {x, y, w, h?, deg?}: fractions of the picture, h left out keeps its shape).

  • {layer: name, set: {name?, on?, blend?, opacity?, mask?, box?, fill?, content?}} (mask: null removes it; {target: name, set} works too when no adjustment has that name); {layer: name, on: false}; {layer: name, order: as at}; {layer: name, delete: true}. Blend modes: normal, multiply, screen, overlay, soft-light, hard-light, darken, lighten, color-dodge, color-burn, difference, exclusion, hue, saturation, color, luminosity. A layer's mask is in the picture's coordinates and reads the layers below it. Up to 12 layers and 4 photos on a canvas. Ops (settings, ranges, defaults): crop {x 0..1 =0, y 0..1 =0, w 0..1 =1, h 0..1 =1, ratio}: Keep a rectangle of the picture; later fractions refer to the kept part straighten {deg -45..45 (required)}: Turn about the centre (positive is clockwise), then keep the largest centred box of the same aspect with no empty corners; bilinear turn {quarter 0|90|180|270 =0, flip ""|"h"|"v"|"hv" =""}: Turn by quarter turns clockwise, then flip; exact pixel moves exposure {ev -4..4 (required)}: Linear light × 2^ev whiteBalance {temp -1..1 =0, tint -1..1 =0}: Channel gains in linear light: temp warms (+) or cools (−), tint adds magenta (+) or green (−); grey keeps its brightness contrast {amount -1..1 (required)}: An S-curve about mid-grey on encoded values (negative flattens) levels {black 0..254 =0, white 1..255 =255, gamma 0.1..10 =1}: Per channel: (v − black) / (white − black), then the power 1/gamma, on encoded values curves {rgb, r, g, b}: Monotone cubic (Fritsch–Carlson) through [in, out] points 0..255; a channel curve, then the rgb curve hueSat {hue -180..180 =0, sat 0..3 =1}: SVG feColorMatrix hueRotate × saturate, one 3×3 matrix on encoded values; turns every colour by the same angle, so to make something one given colour (blue eyes, a red shirt) use colorize colorize {color ="#3d7fd9", amount 0..1 =1}: Make it this colour: each pixel takes the colour's hue and saturation and keeps its own lightness (the "color" blend), so its texture and shading stay; for recolouring eyes, clothes or a wall, through a mask vibrance {amount -1..1 (required)}: Saturation scaled by 1 + amount·(1 − s)², s the pixel's own saturation: dull colours move most blur {sigma 0..0.05 =0.003, direction "both"|"horizontal"|"vertical"}: Separable Gaussian, radius ⌈3σ⌉, edges clamped at the picture's edge; direction "vertical" or "horizontal" blurs one way only, which smooths away lines across that way and keeps lines along it (a vertical blur removes a horizontal seam on vertically ribbed knit and keeps the ribs) smoothTone {sigma 0.0005..0.05 (required), detail 0.0002..0.02 =0.002, direction "both"|"horizontal"|"vertical"}: Smooth light and shade but keep texture (frequency separation): the picture is split into its shading (a blur of detail) and its fine detail (the rest); the shading is blurred by sigma (one way with direction) and the detail added back, so weave, pores and grain stay while blotches, lines and shadows across them even out. A seam sharper than detail stays in the detail: there a one-way blur is the better tool sharpen {sigma 0..0.01 =0.0005, amount 0..5 =0.5, threshold 0..255 =0}: Unsharp mask on luminance: L + amount·(L − blur(L)) where |L − blur(L)| passes the threshold vignette {strength -1..1 =0.3, midpoint 0..0.99 =0.5, roundness 0..1 =0}: Multiply by a smooth radial falloff, 1 inside the midpoint, 1 − strength at the corners grain {amount 0..1 =0.2, size 0.00005..0.01 =0.0003}: Luminance noise hashed from the position in the original photo, averaged over each pixel's footprint, so it lands the same at every size clone {from {x, y} 0..1 (required), to {x, y} 0..1 (required), r 0.001..0.25, shape, feather 0..0.25, opacity 0..1 =1}: Copy a soft-edged patch of the picture from one place to another, as a clone stamp does: a disc of radius r at to, or a shape (an ellipse at to, or a brush stroke along points: one call patches a whole seam), copied from the same offset from − to; bilinear. With a mask, only the masked pixels change heal {from {x, y} 0..1 (required), to {x, y} 0..1 (required), r 0.001..0.25, shape, feather 0..0.25, opacity 0..1 =1}: A clone matched to where it lands: the colour difference along the patch's rim is spread smoothly over it, so texture comes from the source and tone from the surroundings. With a mask, the rim is read only where the mask is (so dark edges beside a narrow opening do not tint it) and only the masked pixels change spot {x 0..1 (required), y 0..1 (required), r 0.001..0.1 (required)}: Heal a small disc from the best nearby source: 48 places around it (3 distances, 16 directions) are scored by how well their surroundings match, on a grid set by the spot's size, so every size picks the same one remove {stroke, shape, feather 0..0.25, opacity 0..1 =1}: Remove a distraction (wire, pole, person, blemish) in one call from surrounding real pixels with seamless boundary matching (never generative fill): give a stroke {points, width}, shape ({kind: "ellipse", cx, cy, rx, ry} or {kind: "stroke", points, width}), or mask mask (optional, on any op but crop, straighten and turn): {shapes?: [...], range?: {by, from, to, soft?}, select?: {id}, invert?}, at least one of shapes, range and select. select: a smart selection photo_select made (its id): the subject, the background, the sky or an object, as a model found it; with shapes or range it applies only where both do; invert: true then means everything but it. A selection is made on the photo after its crop, straighten and turn, so a select mask goes on an adjustment after those (or on an adjust layer, or a layer's mask); change the crop, straighten or turn afterwards and select again. range picks pixels by their own value as the photo is at that step: by "luma" (0..1), "hue" (degrees, from 330 to 30 is the reds; grey is left out) or "saturation" (0..1), soft fading outside from..to in the same units (default 0.1, or 20 for hue); with shapes it applies only within them. Each shape: {kind: "ellipse", cx, cy, rx, ry, angle?, feather}, {kind: "rect", x, y, w, h, r?, angle?, feather}, {kind: "linear", x1, y1, x2, y2} (full at the first point, none at the second), {kind: "radial", cx, cy, r, feather}, {kind: "stroke", points: [[x, y], ...], width, feather}, each with mode "add" (default), "subtract" or "intersect". Everything is a fraction of the picture: x and widths of its width, y and heights of its height, radii, widths, feather and sigma of its long side.

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": {
      "edits": "<edits>"
    },
    "name": "photo_edit"
  }
}

Input Schema

NameRequiredDescriptionDefault
nextNowhat the next call will do
noteNowhat this call does, shown to people watching
editsYes
canvasNo
previewNo
request_idNo
expected_revisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Beyond readOnlyHint=false, openWorldHint=false, and destructiveHint=false, it discloses collaborative visibility ('everyone watching sees each call land'), replay/undo semantics, hard limits (30 edits per call, 60 adjustments per layer, 12 layers, 4 photos), and mask coordinate/timing rules. It also explains that switching off preserves an adjustment and that delete operations are replay steps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded and uses bullets, but it is extremely long and dense, with an exhaustive op dictionary and repeated layer/mask syntax. Much of that detail is necessary because the schema is thin, yet the wall-of-text presentation hurts scanability. It is organized rather than concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-complexity editor with no output schema and low schema coverage, it covers the core edit language, mask selection timing, layer limits, and undo/visibility behavior. The main omissions are the concurrency/control parameters expected_revision, request_id, and canvas, plus return behavior beyond preview='after'. Those gaps matter, but the core invocation path is well specified.

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?

The schema has only 29% description coverage and leaves edits items as bare objects, while the description supplies the full edit grammar: add/set/on/order/delete, layer placement, masks, and op settings. It also explains preview='after'. It does not explain expected_revision, request_id, or canvas, so top-level parameter coverage is incomplete.

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?

The opening sentence names the exact operations and resource: 'Add, change, switch off, reorder or remove the photo's adjustments.' It also frames the tool as one replay step that photo_undo reverses, clearly distinguishing it from photo_undo, photo_select, and photo_place.

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?

It gives explicit routing for masks: whole subjects, sky, or objects via photo_select; irregular traced areas via a stroke; and photo_look zoom checks before and after placing shapes. It also steers color changes to colorize rather than hueSat and points to photo_undo for reversal. It lacks a top-level 'use this instead of X' rule for the entire editing tool, but the in-tool alternatives are unusually clear.

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.