Skip to main content
Glama

Generate images with Codex

codex_image

Generate image assets using Codex's built-in image generator without an API key, then save them to a folder and return previews for icons, sprites, illustrations, textures, or UI mockups.

Instructions

Generate image assets with Codex's built-in image_gen tool (GPT Image), billed to the user's ChatGPT/Codex plan — no API key. Files are copied into out_dir and small previews are returned so you can check them. Use for icons, sprites, illustrations, textures, UI mockups and similar. Supports transparent backgrounds and reference images. Each image typically takes 30-120 s.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoFile name prefix, e.g. 'coin-icon'.
sizeNoe.g. '1024x1024', '1536x1024', '16:9', 'square'.
countNoNumber of images/variants (default 1).
modelNoModel for the Codex agent turn that calls image_gen (not the image model). A fast model is enough.
promptYesArt direction: subject, style, palette, composition, intended use.
out_dirNoAbsolute folder to save into (created if missing). Default: /root/Pictures/codex-assets
transparentNoRequest a real transparent background.
wait_secondsNoSeconds to wait before returning a job_id (0-240, default 50).
return_imagesNoEmbed previews in the result (default true).
reasoning_effortNolow | medium | high | xhigh | max | ultra — support varies per model (see codex_models). Omit for the default.
reference_imagesNoAbsolute paths of images to edit or match.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.4/5.0
Behavior5/5

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

Adds substantial context beyond the annotations (openWorldHint, destructiveHint=false): billing to the user's ChatGPT/Codex plan with no API key, files copied into out_dir, previews returned for verification, transparent/reference-image support, and a 30-120 s latency expectation. The latency and billing disclosures are exactly the behavioral traits an agent needs.

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?

Five tight sentences, front-loaded with what the tool is and the billing model, then capabilities, then latency. No filler and every sentence carries distinct information.

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?

Covers purpose, cost, output location, previews, capabilities and timing for an 11-param tool. It stops short of explaining the async/job_id behavior implied by wait_seconds, which matters with no output schema, but otherwise the agent has enough to invoke it correctly.

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%, so the schema already documents all 11 parameters thoroughly; baseline is 3. The description reinforces a few (out_dir copying, transparent backgrounds, reference images) but adds no syntax or format detail beyond the schema text.

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?

States a specific verb+resource ('Generate image assets') and names the underlying mechanism (Codex's built-in image_gen / GPT Image), which clearly separates it from siblings like codex_job, codex_task, and codex_models.

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?

Gives concrete use cases ('icons, sprites, illustrations, textures, UI mockups and similar'), so the agent knows when this tool applies. However, it never names an alternative or states when NOT to use it (e.g. vs codex_task), so routing guidance is clear but incomplete.

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