Skip to main content
Glama

Inpaint image

inpaint_image

Edit only a masked area of an image: change, remove, replace, or add content while preserving all pixels outside the mask. White marks the target; black stays unchanged.

Instructions

Change only the masked area of an image (mask: white = change, black = keep): edit it, remove what is there, replace it, or add something inside it. The model is shown the area marked on a copy of the image; pixels outside the mask are preserved exactly.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoSeed for reproducible results; omit or -1 for random
actionNoedit: change the area as the prompt says; remove: erase what is there and fill with background (prompt optional, e.g. 'the bin'); replace: put the prompt's subject in its place; add: add the prompt's subject inside the areaedit
promptNoThe change, or the subject to add/replace with; optional for remove
qualityNoAll run Qwen-Image 2.1 Turbo (8 steps): fast = ~1 MP (the default, fastest); balanced = ~1.5K; quality = native 2K (slowest; edits share 2K with their references)
mask_pathYesMask image: white = area to change, black = keep (or opaque strokes on a transparent layer)
image_pathYes
output_pathNoOptional destination (absolute, or relative to the project). Must be inside the project or the app output folder. Existing files are never overwritten; a numbered name is used instead.
include_previewNoAlso return a small JPEG preview in the tool result. Default false: images stay local and are not sent to the model.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.9.3

TDQS

A4/5.0
Behavior4/5

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

Annotations cover the safety profile (destructiveHint=false, non-idempotent), and the description adds real behavioral context beyond them: that pixels outside the mask are preserved exactly and that the model sees the marked region on a copy of the image. It does not discuss failure modes or how the non-idempotent seed affects reruns, so not a 5.

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?

Two sentences, the core constraint front-loaded in the first clause, and the second sentence adds a genuinely useful guarantee. No filler.

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 an 8-parameter generation tool with no output schema, the description adequately explains the transformation and preservation guarantee, leaving quality/seed/output_path details to the well-covered schema. It omits any note on runtime or result handling, a minor gap.

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 88%, so the schema already carries nearly all parameter meaning. The description restates the mask convention (white = change, black = keep) and the four action modes, which duplicates rather than extends the schema. Baseline 3 is correct.

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?

States a precise verb+resource+scope: 'Change only the masked area of an image' with an immediate inline definition of mask semantics. This distinguishes it cleanly from siblings like edit_image (whole image) and outpaint_image (extends canvas).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The mask semantics imply when the tool applies (partial, localized edits), but there is no explicit routing guidance versus edit_image, edit_images, or outpaint_image. The agent must infer the boundary from the mask requirement alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.