Skip to main content
Glama

Generate image (ChatGPT)

generate_image

Create images from text prompts and save them to disk, using the local ChatGPT app and your account without an API key. Pass reference images to guide style and composition.

Instructions

Generate images with ChatGPT's image generator, through the ChatGPT/Codex app installed on this machine and the user's ChatGPT account (no API key). Local images can be passed as style/composition references. Each call takes about 30-90 seconds. Saves the files to disk and returns their paths plus a preview.

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
nNoNumber of variants to generate.
promptYesDetailed description of the image to generate.
filenameNoBase file name without extension (e.g. 'hero-banner'). Default: timestamp.
output_dirNoAbsolute directory to save files in. Default: /root/Pictures/chatgpt-images
orientationNoImage orientation.auto
transparentNoTransparent background (PNG with alpha).
include_previewNoIf true, also return the image so the assistant can see it.
reference_imagesNoAbsolute paths of images to use as references (optional).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.8/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 well: it discloses the execution path (local ChatGPT app, user's account, no API key), latency (30-90s), and that files are written to disk with paths plus a preview returned. Gaps remain on overwrite behavior for existing filenames and what happens if the app is not running or generation fails.

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?

Four short sentences, front-loaded with purpose and mechanism, then side effects and timing. Every sentence contributes new information with no repetition of the schema.

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 an 8-parameter generation tool with full schema coverage and no output schema, the description covers mechanism, cost, side effects, and return shape adequately. The main missing piece is failure/overwrite behavior, which matters for a tool that writes to disk.

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 coverage is 100%, so the baseline is 3. The description adds only marginal meaning beyond the schema: it clarifies that reference_images act as style/composition references rather than literal edits. The n, orientation, transparent, and include_preview parameters are left entirely to the schema.

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 images with ChatGPT's image generator') and names the underlying mechanism (ChatGPT/Codex app, user's account, no API key). It does not, however, distinguish this from the sibling edit_image, leaving the generate-vs-edit boundary implicit.

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?

Usage context is implied: the tool is for creating new images, accepts local files only as style/composition references, and takes 30-90 seconds per call. There is no explicit 'use this instead of edit_image when...' routing guidance, so the agent must infer the alternative.

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