Skip to main content
Glama

Generate an image with OpenAI

chatgpt_generate_image

Create images from text prompts using OpenAI's image model, return them for Claude to view and describe, and optionally save them to disk.

Instructions

Create an image from a text description using OpenAI's image model (the same family ChatGPT uses). The image is returned so Claude can see and describe it. If IMAGE_OUTPUT_DIR is set, it is also saved to disk.

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": "chatgpt_generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
sizeNoImage size. 1536x1024 is landscape, 1024x1536 is portrait. Default: auto.
countNoHow many images (1 to 4). Default 1.
modelNoImage model. Default: OPENAI_IMAGE_MODEL (gpt-image-2).
promptYesA detailed description of the image.
qualityNoQuality. Higher costs more.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.2.0

TDQS

A4/5.0
Behavior4/5

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

The annotations only declare readOnlyHint=false and openWorldHint=true, so the description has to disclose the rest of the behavior, and it does: it states that the image comes back inline so Claude can see it, and that a copy is also written to disk when IMAGE_OUTPUT_DIR is set. Aspects such as cost, latency, and return encoding are left open, but the destination behavior, which is the most decision-relevant point, is covered.

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?

Two sentences contain no filler. The first sentence puts the core purpose and provider first, and the second covers the return and persistence behavior. Every sentence earns its place.

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?

With no output schema and only two annotations, the description must explain what comes back, and it does by stating that the image is returned for Claude to see. Remaining gaps are minor: there is no mention of cost or latency for a paid generation call, and no hint that quality and count affect billing.

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%, and every parameter (prompt, size, count, quality, model) is already documented in the schema, including enum meanings and defaults. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies.

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?

The description uses a specific verb and resource: 'Create an image from a text description using OpenAI's image model'. The provider and the model family are both named, so the tool is clearly distinct from the text-oriented siblings (chatgpt_ask, chatgpt_structured, etc.) without having to open any schema.

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 conditions for calling the tool are only implied: you use it when you need an image. There is no explicit 'use this instead of X', no guidance about cost trade-offs, and no statement of when generating an image is a poor fit. The note about IMAGE_OUTPUT_DIR sits under behavior, not usage.

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