Skip to main content
Glama

image_batch_edit

Apply a single editing prompt to multiple images simultaneously, returning edited results for each input image. Handles up to 20 images per batch with independent error handling.

Instructions

批量图像编辑:N 张输入图 → N 张输出图,每张独立应用同一指令。

[WHAT] 对 image_paths 里的每一张图分别调用 image_edit,统一 prompt 与 size,结果合并返回。

[WHEN TO USE]

  • 用户提供多张图且每张要做"同样的修改"(如批量加水印 / 统一换底 / 统一调色)→ 用此 tool。

  • 如果是"用多张图作风格参考画 1 张新图" → 这不是此 tool,暂未实现。

  • 如果只有 1 张图 → 用 image_edit。

[并发策略]

  • non-pro 模型:5 并发(HTML 网页同款)。

  • pro 模型:串行 + 1.5s gap(代理对 pro 并发会拒)。

  • 任意一张失败不影响其他张;返回 results 里逐张标 ok/error。

[LIMITS]

  • 同 image_edit:size 仅 1K 档(≤1536 边长),≥2K 拒绝。

  • image_paths 长度建议 2-20 张;过多请分批调用避免超时。

Args: prompt: 应用到每张图的修改指令。例:"add a subtle watermark in bottom-right". image_paths: 输入图路径列表(绝对或相对)。 size: 输出 size,仅 1K 档。默认 "1024x1024"。 model: "gpt-image-2" / "gpt-image-2-pro"。留空按 size 自动选。 save_dir: 输出目录(必须在安全根目录之下)。文件名 batch__.png。 api_key: 覆盖 MICU_API_KEY;base_url 已锁在启动期 env,运行期不接受。

Returns: dict 含: ok (bool): True 表示至少 1 张成功。 total (int): 输入图总数。 succeeded (int): 成功张数。 failed (int): 失败张数。 concurrency (int): 实际用的并发度(5 或 1)。 results (list[dict]): 每张图的详细结果(含 input 路径、saved.path、可能的 error)。

Examples: image_batch_edit( prompt="convert to pencil sketch style", image_paths=["/p/a.jpg", "/p/b.jpg", "/p/c.jpg"], size="1024x1024", )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
promptYes
image_pathsYes
sizeNo1024x1024
modelNo
save_dirNo
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully discloses behavioral traits: concurrency strategy (5 for non-pro, serial with gap for pro), error handling (one failure does not affect others), size limitations, output naming, and that base_url is locked. No contradictions.

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 description is well-structured with clear sections ([WHAT], [WHEN TO USE], [并发策略], [LIMITS], Args, Returns, Examples). It is front-loaded with the core purpose and every sentence adds value. No unnecessary repetition.

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 tool's complexity (6 parameters, output schema, sibling tools), the description covers all necessary aspects: purpose, usage guidelines, behavioral details, parameter semantics, return values, and examples. The output schema is described in the Returns section. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates excellently by explaining each parameter in the Args section, including examples, constraints (e.g., size only 1K, model values, save_dir must be under root), and the api_key override behavior.

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?

Description clearly states the tool's function: batch editing of N images with identical prompt and size, mapping N inputs to N outputs. It distinguishes from sibling tools by specifying that multi-reference style transfer is not supported and that single-image editing should use image_edit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use (multiple images each needing the same modification), when not to use (multi-reference to generate one image), and provides alternative (image_edit for single image). Also includes batch size limits and concurrency strategy.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Subaru486desuwa/micu-image-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server