Skip to main content
Glama

Inpaint image

inpaint_image

Change only the masked area of an image—edit, remove, replace, or add content there—while preserving every pixel outside the mask.

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.

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": {
      "image_path": "<image_path>",
      "mask_path": "<mask_path>"
    },
    "name": "inpaint_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoSeed for reproducible results; omit or -1 for random. Never reuse the seed the source image was generated with: use a different one or omit it
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. Changed1 schema field changedv0.10.2
    • changedInput schema / properties / seed / description
      Previous value: -"Seed for reproducible results; omit or -1 for random"New value: +"Seed for reproducible results; omit or -1 for random. Never reuse the seed the source image was generated with: use a different one or omit it"
  2. 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 (not read-only, not destructive), so the bar is lower, and the description still adds real behavior: the model sees only a copy with the marked area, and unmasked pixels are preserved exactly. It does not mention that existing output files are never overwritten, but that is carried by the schema.

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 tight sentences, front-loaded with the core constraint and the mask convention, then the preservation guarantee. No filler and nothing buried.

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 covers the essential contract: mask semantics, what is preserved, and the range of edits. The only gap is sibling differentiation, which the high schema coverage partly offsets.

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 coverage is 88%, so the schema already documents most parameters well. The description reinforces the mask semantics and sketches the action modes ('edit it, remove what is there, replace it, or add something inside it'), but adds no meaning beyond the enum descriptions in the schema.

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 specific verb and scope: change ONLY the masked area of an image, with the mask convention spelled out (white = change, black = keep). This clearly separates it from whole-image siblings like edit_image, outpaint_image and upscale_image without needing to name them.

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 description implies when to use it via the masking constraint ('pixels outside the mask are preserved exactly'), which tells an agent this is the localized-edit tool. However, it never explicitly routes against alternatives such as edit_image or outpaint_image, leaving the choice to inference.

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