Skip to main content
Glama

Edit an image you already have (inpainting)

ai_image_edit

Use when an agent must change part of an image and leave the rest untouched: pass the image and a black-and-white mask, and Stable Diffusion inpainting repaints only the white area following your prompt. Image and mask go as https URLs or as base64, up to 10 MB each. Returns a hosted image URL valid for 24 hours. You are only charged if the edit is delivered. No API key, no account. $0.02 per call, paid over x402 (USDC).

Input Schema

NameRequiredDescriptionDefault
urlNohttps URL of the image to edit. Use this or image.
maskNoThe mask, as base64. Use this or mask_url.
seedNoSame inputs and same seed give the same edit.
imageNoThe image to edit, as base64. Use this or url.
stepsNoDiffusion steps, 1-20.
promptYesWhat to paint into the masked area, up to 2048 characters.
guidanceNoHow closely to follow the prompt, 0-20.
mask_urlNohttps URL of the mask: white where it should repaint, black where it must not. Use this or mask.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations to lean on, the description carries the full burden and does so well: 10 MB per-asset limit, a hosted URL valid 24 hours, billing only on delivered edits, $0.02 per call over x402/USDC, and no API key or account required. These are exactly the operational traits an agent cannot infer from 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.

Conciseness4/5

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

The use case and mask semantics are front-loaded, and every clause contributes. The payment/pricing sentence is dense but relevant for an unauthenticated paid endpoint; still, the run-on single-sentence structure could be split for faster scanning.

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

Completeness5/5

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

For an 8-parameter, single-required-input tool with no output schema, the description covers inputs, size limits, the return value (24-hour hosted URL), cost and payment method. An agent has everything needed to decide to call it and interpret the result.

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?

Schema coverage is 100%, so baseline is 3, but the description synthesizes what the schema states per-property: the mutual exclusivity of url/image and mask/mask_url as URL-or-base64 alternatives, plus the shared 10 MB cap. It stops short of touching sampling knobs like steps, guidance or seed, which remain schema-only.

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 names a specific verb and effect — "change part of an image and leave the rest untouched" — plus the concrete mechanism (mask-based inpainting repainting only the white area). This clearly separates it from sibling image tools like ai_image, ai_image_styled and ai_image_describe, which generate or analyze whole images.

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?

"Use when an agent must change part of an image and leave the rest untouched" gives a clear triggering condition and implicitly excludes full-image generation or description. It never names an alternative sibling or states a when-not case explicitly, so it falls short of a 5.

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