Skip to main content
Glama

Run Edit Tool

run_edit_tool

Run a canvas edit tool on an image via /v2/edit/tools/{tool_id}.

$0.001 tools (per frame for animated inputs): color_reducer, palette_converter, pixel_correction, k_centroid_downscale, rotate. $0.01 tools: background_remover, color_style_transfer. $0.12 tools (RD Core, in the picture's own style): image_edit, inpainting, outpainting, seam_tiling. Use estimate_edit_tool_cost first for anything that charges — estimation is free. The edited image is returned in base64_images.

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": {
      "tool_id": "<tool_id>",
      "input_image": "<input_image>"
    },
    "name": "run_edit_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoSeed for reproducible results; reuse the same seed to iterate on one composition.
widthNok_centroid_downscale: target width in pixels (required for that tool).
heightNok_centroid_downscale: target height in pixels (required for that tool).
promptNoWhat to generate or change (required by image_edit and inpainting; optional for outpainting).
tile_xNoseam_tiling: repair the horizontal seam (tool default applies when omitted).
tile_yNoseam_tiling: repair the vertical seam (tool default applies when omitted).
tool_idYesEdit tool id. One of: image_edit, inpainting, outpainting, seam_tiling, background_remover, color_style_transfer, color_reducer, palette_converter, pixel_correction, k_centroid_downscale, rotate. Use list_edit_tools for authoritative fields, costs, and limits.
expand_topNoOutpainting: pixels to add on the top edge.
mask_imageNoBase64 mask for inpainting: white pixels are regenerated, black pixels are kept.
rd_api_keyNoRetroDiffusion API key (rdpk-...) for this call only; overrides session or header auth.
seam_widthNoseam_tiling: width in pixels of the seam band to repair.
color_countNocolor_reducer: target number of colors.
dither_modeNocolor_reducer/palette_converter: dithering mode.
expand_leftNoOutpainting: pixels to add on the left edge.
input_imageYesBase64 PNG of the image to edit (raw base64 or a data URL). Required by every edit tool.
expand_rightNoOutpainting: pixels to add on the right edge.
soft_inpaintNoInpainting/outpainting: blend edits softly with the surrounding pixels.
expand_bottomNoOutpainting: pixels to add on the bottom edge.
input_paletteNoBase64 image of a color palette; output colors are constrained to it.
dither_strengthNocolor_reducer/palette_converter: dithering strength, 0-10 (0 disables, default 5).
timeout_secondsNoRead-timeout override in seconds for this call; increase for animations or large batches.
rotation_degreesNorotate: rotation angle in degrees (clean-edge pixel rotation).
extra_input_imageNoSecond base64 input image for styles that use one (e.g. the second texture in rd_tile__tileset_advanced).
force_solid_pixelsNobackground_remover: force fully solid or fully transparent pixels (tool default applies when omitted).
repair_window_sizeNoseam_tiling: size of the repair window.
transparency_thresholdNobackground_remover: alpha threshold for treating pixels as transparent.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / dither_strength / description
      Previous value: -"color_reducer/palette_converter: dithering strength."New value: +"color_reducer/palette_converter: dithering strength, 0-10 (0 disables, default 5)."
  2. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true, non-idempotent and non-destructive; the description adds genuinely new behavior: per-tool pricing tiers, per-frame charging for animated inputs, and where the result lands ('returned in base64_images'). It omits auth handling (rd_api_key in schema), latency/timeout expectations, and failure modes.

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 and endpoint, then a compact cost table that directly serves tool selection, then the return-value location. The pricing enumeration is dense but every line earns its place; only slight tightening is possible.

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 26-parameter dispatcher with an output schema present, the description covers cost, the endpoint contract, and result placement while correctly deferring per-tool field authority to list_edit_tools. Remaining gaps are auth scope and timeout behavior for long-running animated inputs, which matter for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and every tool-specific parameter (mask_image, dither_strength, expand_*, seam_width) is already documented in the schema. The description adds only an implicit mapping between price tier and tool_id, not new guidance on parameter meaning or tool/parameter coupling.

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 description opens with a specific verb+resource+endpoint ('Run a canvas edit tool on an image via /v2/edit/tools/{tool_id}') and enumerates the concrete tool ids it dispatches to. It is clearly distinguishable from the sibling estimation and listing tools, which it references by name rather than duplicating.

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?

Explicitly routes cost-sensitive calls to estimate_edit_tool_cost ('estimation is free'), which is a real when-to-use rule against a named alternative. It does not state when *not* to use this tool, nor does it differentiate from other mutating siblings such as fix_pixel_art, so it falls short of full routing guidance.

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.