Skip to main content
Glama

通过 Responses 生成图片

generate_image_via_responses

Generate or edit images from text prompts and reference images using OpenAI's Responses API, including multi-turn edits via previous_response_id.

Instructions

通过 OpenAI Responses API 的 image_generation 工具生成图片,支持 previous_response_id 多轮编辑与参考图输入。

Input Schema

NameRequiredDescriptionDefault
sizeNo图片尺寸:auto 或 宽x高;不同模型对尺寸的限制不同。auto
modelNo图像模型 ID,例如 gpt-image-2.5-flare;必须以 gpt-image- 开头。
actionNoauto
effortNoResponses 文本模型的推理强度;省略时使用 GPT_IMAGE_REASONING_EFFORT(默认 high,设为 none 可禁用)。
imagesNo
inlineNo是否以 MCP image content 内联返回图片;设为 false 时必须提供 output_path。
promptYes图像生成或编辑的提示词(1-32000 个字符)。
qualityNo生成质量;xhigh 与 max 仅 gpt-image-2.5 系列支持。medium
overwriteNo是否允许覆盖已存在的文件。
backgroundNo背景模式;transparent 只能配合 png 或 webp。auto
text_modelNo图像模型 ID,例如 gpt-image-2.5-flare;必须以 gpt-image- 开头。
output_pathNo保存路径:目录或以 / 结尾时按 image_1.ext 命名,文件路径且 n>1 时按 stem-1.ext 命名。
previous_response_idNo

Output Schema

NameRequiredDescriptionDefault
sizeNo
modelYes
usageNo
imagesYes
qualityNo
warningNo
response_idNo
saved_pathsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, destructiveHint=false, so the mutation and external-dependency profile is partly carried structurally. The description adds useful context that the call runs through the OpenAI Responses API and can be chained via previous_response_id, but it never mentions that results can be written to disk (output_path/overwrite), says nothing about latency, cost, or failure behavior for this remote call. No contradiction with annotations.

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?

A single front-loaded sentence that states the mechanism (Responses API image_generation) first, then the differentiating capabilities. No filler, no repetition of the tool name, nothing wasted.

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

Completeness3/5

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

An output schema exists, so return-value explanation is correctly omitted, and the rich schema covers most operational detail. But for a 13-parameter tool with sibling confusion, the description leaves two material gaps: how this differs from generate_image/edit_image, and that the call can persist files to disk. Adequate, not complete.

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 description coverage is 77%, so the schema already explains most fields, but two parameters carry no schema description at all: previous_response_id and the action enum. The description supplies real semantics for the first of these ('多轮编辑'), and '参考图输入' clarifies the role of the images array beyond its format description. That is genuine added meaning rather than restatement.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The name and title state a specific verb and resource (generate images via the OpenAI Responses API image_generation tool), and the description adds the two capabilities that define this particular variant: previous_response_id-driven multi-turn editing and reference-image input. However, it never names its siblings generate_image and edit_image, so an agent cannot tell from the description alone which of the three to pick.

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?

Mentioning 'supports previous_response_id multi-turn editing and reference image input' implies the selection condition (use this when continuing an existing image conversation or supplying reference images), but the guidance is never made explicit. There is no statement of when NOT to use it and no reference to generate_image or edit_image as alternatives, leaving the routing decision to inference.

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