Skip to main content
Glama

retouch

Destructive

Heal or clone pixels with a round brush. method heal paints a stroke that samples texture from elsewhere and blends it into its surroundings, for blemishes, dust and scratches; clone paints a stroke that copies the sampled pixels exactly; spot_heal takes round spots {x, y, radius} and picks each one's source automatically, from the nearby area whose brightness and texture best match the ring around the spot. Everything is in photo pixels. By default (target retouch_layer) the paint lands on a "Retouch" copy of the layer directly above it, shown only where you painted, so the original and the picture everywhere else stay untouched; later calls reuse that copy while it stays directly above the layer it was made from. target in_place paints the layer itself, and is required for a layer that is below 100% opacity, not in Normal mode, or has a layer mask; a layer with semi-transparent pixels also shows its original through the copy, so use in_place there. The current selection is kept and does not clip the retouch. Refuses layer groups, text layers, locked or hidden layers, indexed photos, and any point or spot outside the layer. A call has a work limit (a long stroke with a big brush, or many large spots): split it into several calls or use a smaller brush. Do NOT use for removing whole objects (use remove_object for those); a stroke or spot only blends in texture at the size of the brush. Returns layer_id, layer_name, created_layer, painted_bbox [x, y, w, h] and, for spot_heal, each spot's chosen source offset and score (lower is a closer match). To remove a whole object, use remove_object.

Input Schema

NameRequiredDescriptionDefault
imageYesImage id, as returned by open_photo.
layerNoName of the pixel layer to retouch. Defaults to the selected layer, or the topmost layer if none is selected.
spotsNospot_heal: [{x, y, radius}] in image pixels (1-50 spots, radius 1-500). The source for each is picked from 8 directions at about 2.2x and 3.5x the radius, by how closely its brightness and texture match the ring around the spot. Every source is chosen before anything is painted, so a spot with no usable source fails the whole call unchanged.
methodYes'heal': paint a stroke that blends the sampled texture into its surroundings (blemishes, dust, scratches). 'clone': paint a stroke that copies the sampled pixels exactly. 'spot_heal': round spots, each healed from an automatically chosen nearby source.
pointsNoheal / clone: the stroke as [[x, y], ...] in image pixels (1-500 points), every one inside the layer.
sourceNoheal / clone: the image-pixel point to sample for points[0]; the rest of the stroke samples at the same offset. Give this OR source_offset.
targetNo'retouch_layer': paint on a 'Retouch' copy directly above the layer (made on the first call, reused while it stays directly above the layer it was made from); needs a Normal mode, 100% opacity layer without a layer mask. 'in_place': paint the layer itself.retouch_layer
hardnessNoheal / clone: brush edge hardness, 0 soft to 1 hard. Default 0.5 for heal, 0.8 for clone. Not allowed with spot_heal.
layer_idNoLayer id, as inspect (and any tool that creates a layer) reports it. Takes priority over `layer`, and is the only way to address one of two layers that share a name.
brush_sizeNoheal / clone: brush diameter in pixels. spot_heal sizes its own brush.
source_offsetNoheal / clone: sample this many pixels from each stroke point (source = point + offset). Give this OR source.
source_layer_idNoclone only: sample from this pixel layer instead of the one being painted. The source point plus the stroke must lie inside it.

Output Schema

NameRequiredDescriptionDefault
spotsNo
methodNo
targetNo
hardnessNo
layer_idNo
brush_sizeNo
layer_nameNo
painted_bboxNo
created_layerNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only say destructive/open-world/non-idempotent; the description adds the real behavioral context: a 'Retouch' copy is created above the layer on first call and reused while it stays adjacent, selection is kept and does not clip, and the tool refuses groups, text layers, locked/hidden layers, indexed photos and out-of-layer points. It also warns about a per-call work limit and how to split calls, which annotations cannot convey.

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 well front-loaded: method semantics first, then target/placement, then refusals, then limits. The object-removal warning is stated twice (mid-paragraph and again as the final sentence), which is redundant for a description this long.

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 12-parameter, nested-object, destructive tool, the description covers placement semantics, failure modes, work limits and recovery advice; the output schema exists and the return-value sentence is just a convenience pointer. Nothing needed to call it correctly 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; the description earns above that by adding cross-parameter meaning, notably the `target` decision rules tied to layer opacity/mode/mask and the fact that all coordinates are photo pixels and the source is chosen before any paint. Minor gap: `hardness`, `brush_size` and `layer_id` precedence are left to 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?

Specific verb-plus-resource with the three methods (heal, clone, spot_heal) defined inline and differentiated from each other. It also explicitly distinguishes itself from the sibling `remove_object`, so an agent can route between them without opening schemas.

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?

States when to use each method (blemishes/dust vs exact copy vs auto-sourced spots), when `in_place` is required (below 100% opacity, non-Normal mode, layer mask, semi-transparent pixels), and gives an explicit exclusion: 'Do NOT use for removing whole objects (use `remove_object`)'. Alternatives and boundaries are named, not inferred.

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