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}.

Free tools: color_reducer, palette_converter, pixel_correction, k_centroid_downscale, rotate. $0.01 tools: background_remover, color_style_transfer. Premium ($0.18): 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.

Input Schema

TableJSON 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

TableJSON 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. Added

TDQS

A4.4/5.0
Behavior4/5

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

The description adds useful operational behavior beyond the annotations: per-tool pricing, the endpoint pattern, and the base64_images return format. Annotations already cover read-only/idempotent/destructive hints, so the description isn't burdened with those, and there is no contradiction.

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

Conciseness5/5

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

Every sentence earns its place: endpoint, tool list with costs, free estimation caveat, and output format. It is compact, scannable, and front-loaded with the primary action.

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 tool with 100% schema coverage and an output schema, the description does not need to enumerate parameters. It covers the critical workflow (estimate before paid calls), cost, and output representation, making the definition complete enough for safe invocation.

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?

With 100% schema coverage, the schema already documents most parameters, but the description adds cost categories attached to specific tool_id values, which helps an agent select the right tool parameter. It also notes that the edited image returns in base64, which is relevant to handling the output but not a schema parameter.

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 action and resource—'Run a canvas edit tool on an image via /v2/edit/tools/{tool_id}'—and enumerates the valid tool IDs, making the tool's job unmistakable and separating it from cost-estimation and listing siblings. The name alone is generic, but the description removes ambiguity.

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 an explicit workflow rule: call estimate_edit_tool_cost first for any paid tool, and flags which tools are free versus paid. It does not explicitly say 'use list_edit_tools instead when you only need metadata' or list exclusions, but the pricing guidance is concrete and actionable.

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