Skip to main content
Glama

生成图片

generate_image

Creates images from text prompts and saves them to local disk, returning the absolute path for posters, illustrations, product visuals, icons, or concept scenes.

Instructions

根据文字描述生成图片并保存到本地磁盘,返回保存后的绝对路径。适合海报、插画、产品图、图标、场景概念图等。单次耗时约 40-180 秒。

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": {
      "prompt": "<prompt>"
    },
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
nNo生成张数,1-4,默认 1。数量越多越慢越贵
sizeNo尺寸,如 1024x1024 / 1024x1536 / 1536x1024 / auto。默认 1024x1024
modelNo模型 ID。模型名由中转站决定,可用 check_image_service 列出本站可用模型。当前别名(仅便捷,非通用标准):base=gpt-image-2, pro=gpt-image-2-pro, hq=gpt-image-2-pro, flare=gpt-image-2-5-flare, sunburst=gpt-image-2-5-sunburst。默认 gpt-image-2
promptYes图片描述(建议用英文或中英混合,细节越具体越好)
out_dirNo落盘目录。绝对路径或相对项目根目录;默认 ./output
qualityNo画质:low / medium / high / auto。默认 high
basenameNo文件名前缀(不含扩展名)。不传则按 prompt + 时间戳生成
backgroundNo背景;transparent 出透明底 PNG
output_formatNo期望的输出格式,默认 png

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does add real behavior: persistence to disk, return of an absolute path, and a 40-180 second per-call latency. It omits whether calls cost money, what happens on failure or partial success with n>1, and whether existing files are overwritten — meaningful gaps for a mutating, slow, paid operation.

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?

Three short sentences with no filler, and the core action plus return value are front-loaded ahead of the use-case list and timing note. Slightly more compact than it needs to be, but nothing is wasted.

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 a nine-parameter generation tool with no output schema and no annotations, the description supplies the two things the schema cannot: the return value (absolute path of the saved file) and the expected latency. Operational details like cost and overwrite behavior remain unstated, keeping it below 5.

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 description coverage is 100%, with model aliases, enum values, defaults and the cost/speed tradeoff for n all documented in the schema. The description adds nothing about any of the nine parameters, so the baseline 3 applies.

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?

States a specific verb and resource (generate an image from a text description), plus the side effect of saving to local disk and returning the absolute path. It does not name or differentiate from the sibling tools check_image_service and edit_image, so it falls short of a 5.

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 list of suitable outputs (posters, illustrations, product shots, icons, concept art) implies when to reach for it, but there is no explicit when-not guidance and no mention of edit_image for modifying existing images, which is the most likely routing confusion.

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

Deploy Server

Other Tools