Skip to main content
Glama
zK0G0w

gpt-image-mcp

by zK0G0w

编辑与参考创作

edit_image

Edits local images according to prompts, replaces backgrounds, or creates new images from style/composition references. Supports mask-guided edits and saves output without overwriting originals.

Instructions

读取本机图片,按提示词编辑、替换背景,或参考风格和构图生成新图。请明确各参考图的作用和需要保留的内容;可传遮罩引导局部编辑。保存新文件并返回绝对路径,不覆盖原图。调用会产生 API 费用。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maskNo可选 PNG 遮罩的本机绝对路径,需含透明通道且尺寸与第一张原图一致;透明区域用于引导编辑。
sizeNo输出尺寸:auto 或 WIDTHxHEIGHT(如 1024x1024、1536x1024、3840x2160)。宽高需为 16 的倍数,比例不超过 3:1。auto
formatNo保存的图片格式。png
imagesYes本机原图或参考图的绝对路径,可使用 ~/;按提示词引用的顺序排列。
promptYes图片内容、风格、构图等要求。
qualityNo生成质量,越高通常越慢且费用越高。auto
backgroundNo背景模式;transparent 需配合 png 或 webp 格式。auto
input_fidelityNo编辑时对原图细节的保留程度,high 尽量保留原图主体。
output_compressionNo输出压缩率(0-100),仅 jpeg 和 webp 格式生效。

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
imagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Beyond annotations, the description discloses that it saves a new file and returns an absolute path without overwriting the original, and that the call incurs API costs. This adds meaningful behavioral context that annotations alone don't provide, and it doesn't contradict readOnlyHint=false or destructiveHint=false.

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?

Four short sentences, front-loaded with the core purpose and followed by invocation guidance, output behavior, and cost warning. No filler; each sentence adds distinct value.

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 a 9-parameter tool with an output schema, the description covers the critical operational facts: local input requirement, reference-image handling, mask support, non-destructive output, returned absolute path, and cost. The schema handles parameter details, so nothing essential is missing.

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 100%, so the baseline is 3. The description adds useful guidance about clarifying each reference image's role and what to preserve, which maps to images/prompt, but doesn't add detail beyond the already-rich schema for mask, size, format, or quality.

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 opens with a specific verb and resource: it reads local images, edits them per prompt, replaces backgrounds, or generates new images from reference style/composition. This clearly differentiates it from the generate_image sibling by requiring local image input and an edit/reference workflow.

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?

It lists concrete use cases (edit, background replacement, reference-based generation), instructs users to clarify each reference image's role and what to preserve, and notes when to pass a mask for local edits. It doesn't explicitly name alternatives or exclusions, but the local-image/edit framing makes the appropriate context clear.

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

Install Server

Other Tools