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

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, so the tool is known to mutate state. The description adds value by stating the return format (base64_images) and listing costs for each tool. It does not mention rate limits or auth details, but the cost information is a useful behavioral trait beyond the annotations.

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?

The description is four sentences, each contributing unique information: action, free tools, paid tools, estimation guidance, return format. It is front-loaded with the main purpose and wastes no words. Highly concise and well-structured.

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, 2 required, multiple tools with different requirements), the description is minimal. It does not summarize which parameters are needed for which tool (e.g., mask_image for inpainting). The output schema exists, so return values are covered, but more guidance on parameter selection per tool would improve completeness.

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 the schema already documents all parameters thoroughly. The description adds no additional parameter-level information; it only lists tool names and costs. Baseline 3 is appropriate since the schema carries the burden.

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 clearly states the action ('Run a canvas edit tool on an image') and the resource via endpoint. It enumerates the available tools by cost tier, which differentiates this tool from siblings like estimate_edit_tool_cost and list_edit_tools. The verb+resource is specific and unambiguous.

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 explicitly advises to use estimate_edit_tool_cost first for paid tools, providing a clear when-to-use alternative. It also categorizes tools by cost, helping the agent decide which tool to invoke. It does not explicitly exclude use cases, but the guidance is sufficient for most scenarios.

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.1/5.0
Disambiguation5/5

Each tool targets a distinct operation: authentication, inference (sync/async/edit), style management, listing, and utility. Even similar tools like create_inference and start_inference_job are clearly differentiated by synchronous vs async execution.

Naming Consistency5/5

All tool names follow the same verb_noun snake_case pattern (e.g., create_inference, get_balance, list_available_styles). No mixed conventions or inconsistent verb forms.

Tool Count4/5

With 19 tools, the count is slightly above the typical 3-15 range, but each tool serves a specific and necessary function for pixel art generation, editing, and management, so it remains well-scoped.

Completeness5/5

The tool set covers the full workflow: authentication, cost estimation, synchronous and async generation, style CRUD, edit tools, pixel fixing, and system status. No obvious gaps for the intended domain.