Skip to main content
Glama

codex_generate_image

Generate or edit images via a selected ChatGPT Plus account using Codex CLI and subscription quota, with reference images, transparent backgrounds, custom output paths, and automatic quota refresh.

Instructions

使用指定的 ChatGPT Plus 账号通过 Codex CLI 原生 --enable image_generation 生成或编辑图片(零额外 API 费用,走 Plus 订阅额度)。支持传 reference_images 先读图再改图/图生图、透明底、自定义保存路径 output_path,并自动刷新真实 Plus 额度。

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

Input Schema

NameRequiredDescriptionDefault
sizeNo可选:目标尺寸或比例提示(如 1024x1024、1536x1024、1024x1536、16:9,默认 auto)。
tierNo可选:驱动生图工具的代理模型档位(通常留空跟随 CLI 默认即可)。
modelNo可选:显式指定驱动模型名。
promptYes必填:详细的生图或改图提示词(建议写清主体、构图、风格、文字标签与配色)。
accountYes必填:已选定的 Plus 账号 ID 或自定义备注名(如 plus-1 或 personal)。
qualityNo可选:画质档位(默认 high)。
output_pathNo可选:目标图片文件绝对路径或目标目录路径;不填时若提供了 working_dir 则默认存到 working_dir/generated_images/。
working_dirNo可选:工作区目录绝对路径。
timeout_secondsNo可选:超时秒数(默认 300)。
reasoning_effortNo可选:驱动代理推理深度(默认 medium,减少生图等待时间)。
reference_imagesNo可选:本地参考图/原图绝对路径数组(先让 GPT 读图,再基于原图做修改、重绘或风格迁移)。
transparent_backgroundNo可选:是否要求透明背景(默认 false)。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.3.0

TDQS

A3.7/5.0
Behavior4/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 disclose meaningful behavior: it runs on Plus subscription quota at zero extra API cost, auto-refreshes real quota, and defaults the save location to working_dir/generated_images. It omits failure modes, invalid-account handling, and latency expectations, which keeps it below a 5.

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?

It's a single dense paragraph that front-loads the core purpose and cost model before listing capabilities. No wasted sentences, though the capability list is somewhat packed and could be clearer with structure.

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?

For a 12-parameter tool with no annotations and no output schema, the description is reasonably complete on inputs but never explains what it returns (image path, URL, or status) once generation succeeds. The result contract is left to inference, which leaves a real gap for such a complex tool.

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 coverage is 100% so 3 is the baseline, but the description adds semantic context: reference_images means read-then-edit/image-to-image, and output_path interacts with working_dir for a default directory. It doesn't clarify return/result location, so it can't reach 5.

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 description gives a specific verb and resource (generate/edit images) plus the exact mechanism (Codex CLI native --enable image_generation via a selected Plus account). It clearly distinguishes this from siblings like codex_exec by naming the image-generation flag, though it never explicitly contrasts with them.

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?

It conveys context: needs a specified Plus account, zero extra API cost since it runs on subscription quota, and reference_images enables edit/image-to-image. It never states when to use this versus alternatives (e.g. codex_exec or deepseek_ask), and offers no exclusion or prerequisite guidance beyond requiring an account.

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