Skip to main content
Glama

编辑图片

edit_image

Edit one or more images with prompts and optional masks through the OpenAI Images edit API, using URL, base64, or local file inputs.

Instructions

通过 OpenAI Images API(/v1/images/edits)编辑图片,支持单图、多图、mask 与 gpt-image-2 / 2.5 系列模型。

Input Schema

NameRequiredDescriptionDefault
nNo生成图片数量(1-10,默认 1)。
maskNo图片来源:http(s) URL、base64 data URI 或本地文件路径(本地路径仅 Node 运行时)。
sizeNo图片尺寸:auto 或 宽x高;不同模型对尺寸的限制不同。auto
modelNo图像模型 ID,例如 gpt-image-2.5-flare;必须以 gpt-image- 开头。
imagesYes输入图片列表(1-16 张)。
inlineNo是否以 MCP image content 内联返回图片;设为 false 时必须提供 output_path。
promptYes图像生成或编辑的提示词(1-32000 个字符)。
qualityNo生成质量;xhigh 与 max 仅 gpt-image-2.5 系列支持。medium
overwriteNo是否允许覆盖已存在的文件。
backgroundNo背景模式;transparent 只能配合 png 或 webp。auto
moderationNo内容审核级别(默认 auto)。auto
output_pathNo保存路径:目录或以 / 结尾时按 image_1.ext 命名,文件路径且 n>1 时按 stem-1.ext 命名。
output_formatNo输出图片格式(默认 png)。png
input_fidelityNo输入保真度,仅 gpt-image-1.5 与 gpt-image-1-mini 支持。
output_compressionNo输出压缩率(0-100),仅 jpeg 与 webp 有效。

Output Schema

NameRequiredDescriptionDefault
sizeNo
modelYes
usageNo
imagesYes
qualityNo
warningNo
saved_pathsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

It provides valuable operational context by specifying the reliance on the OpenAI Images API and detailing specialized features like mask support and support for specific model series (gpt-image-2/2.5). This informs the agent about the technological constraints and nature of the operation.

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 definition is extremely concise, using a single, dense sentence to communicate the tool's core function, API mechanism, and key functional scope (single/multi/mask/models) with zero wasted language.

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?

Given the complexity of the input schema (15 parameters, various input types), the description successfully summarizes the operational boundaries and key technological dependencies, ensuring the agent has a complete picture of the tool's capabilities.

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?

The schema description coverage is 100%, meaning the schema handles all technical details for the 15 parameters. The description provides only high-level operational context regarding the tool's function, which meets the minimum viable baseline for documentation.

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 is highly specific, stating the purpose is image editing and explicitly names the OpenAI Images API endpoint (/v1/images/edits). It clearly distinguishes itself from pure generation tools by specifying that it supports masks and multi-image editing.

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 definition sets clear boundaries by focusing exclusively on image editing capabilities (single image, multi-image, mask). This implicitly guides the agent to choose this tool when modification is required, as opposed to when pure content creation is the goal.

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