Skip to main content
Glama

Run Edit Tool

run_edit_tool

Run a canvas edit tool on an image via /v1/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

TDQS

A3.6/5.0
Behavior3/5

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

Description discloses the output format ('base64_images') but does not elaborate on side effects, latency, or whether the original image is preserved. Annotations already indicate destructiveHint=false and readOnlyHint=false, and the description is consistent. No additional behavioral context beyond what annotations provide.

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?

Four sentences with clear front-loading of purpose. Each sentence adds distinct value: endpoint, tool list with costs, preprocessing advice, output format. No redundant or unnecessary text.

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

Completeness3/5

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

Given the tool's complexity (26 parameters, tool_id-dependent requirements), the description provides essential context (cost categories, free vs. paid, output format) but does not explicitly guide parameter selection based on tool_id. Schema handles per-tool parameter details, so this is adequate but could be more helpful.

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%, so baseline is 3. The description does not add meaning beyond the schema for any parameter; all parameter semantics are already covered in the input schema definitions. No credit for repeating schema content.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Run a canvas edit tool on an image') and specifies the endpoint. It lists available tools by cost category, which helps distinguish this tool from sibling tools like estimate_edit_tool_cost. However, it could more explicitly differentiate from other similar run/inference tools.

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?

The description provides explicit guidance: 'Use estimate_edit_tool_cost first for anything that charges'. This tells the agent when to use a different tool before running a paid edit. It implies that free tools can be used directly without estimation, which is helpful for decision-making.

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.

TDQS

A4/5.0
Disambiguation4/5

Most tools have clearly distinct purposes (e.g., create_inference vs start_inference_job vs get_inference_result). However, the difference between create_user_style/update_user_style and per-inference references could still cause confusion, and list_available_models/list_available_styles overlap slightly.

Naming Consistency5/5

All tool names consistently follow a verb_noun pattern (e.g., create_inference, get_balance, list_edit_tools, delete_user_style). No mixing of camelCase or other styles, making the surface highly predictable.

Tool Count5/5

With 20 tools covering authentication, inference (sync/async), styles, editing, cost estimation, and status, the count is appropriate for a pixel art generation API. Each tool addresses a distinct need without bloat.

Completeness4/5

The tool set covers the full lifecycle: auth, cost estimation, synchronous/async generation, style management, editing, and result retrieval. A minor gap is the lack of a tool to list or manage user styles (e.g., get_user_styles), but this is non-critical for core workflows.

Resources