Skip to main content
Glama

Generate image

generate_image
Destructive

Generate images from text prompts using OpenAI image models, saving them to disk as file paths or returning inline base64 data to control payload size.

Instructions

Generate an image from a text prompt using an OpenAI image model. By default returns the local file path(s) the image was saved to rather than inline image data; set returnAs to 'base64' for inline data instead

Input Schema

NameRequiredDescriptionDefault
nNoNumber of images to generate (1-10; dall-e-3 only supports 1)
sizeNoImage dimensions. Depends on the model: GPT image models accept 1024x1024, 1536x1024, 1024x1536, or auto; dall-e-2 accepts 256x256, 512x512, or 1024x1024; dall-e-3 accepts 1024x1024, 1792x1024, or 1024x1792
modelYesOpenAI model to use for image generation
promptYesDescription of the image to generate
returnAsNoHow to return generated images. 'path' (default) saves each image to disk and returns its file path, avoiding the large inline payloads that can exceed an MCP client's tool result size limit. 'base64' returns the image data inline instead, which is more likely to hit that limit for anything but small imagespath
outputPathNoFile path to save the image to when returnAs is 'path'. Ignored when returnAs is 'base64'. If n > 1, a 1-based index is inserted before the file extension for each image. Defaults to a temp file if omitted

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

With readOnlyHint=false and destructiveHint=true already declared, the description still adds real context: by default the image is written to disk and a file path is returned, and base64 inline data risks exceeding an MCP client's result size limit. What it does not disclose is why the operation is destructive — e.g. whether writing to outputPath overwrites an existing file — which is the one behavioral fact an agent most needs before calling it.

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, no waste, and the default return behavior is front-loaded immediately after the purpose statement. Every clause carries information an agent would otherwise have to open the schema to find.

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?

No output schema exists, so the description correctly takes on the burden of describing return values, covering both the file-path and base64 forms. It is nearly complete for a 6-parameter generation tool, with only overwrite/error semantics left unaddressed.

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 explains prompt, model, size, n, returnAs and outputPath in detail. The description restates the returnAs default and the path-vs-inline tradeoff but adds no syntax, format, or constraint information beyond the structured fields, so baseline 3 applies.

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 states a specific verb and resource ("Generate an image from a text prompt using an OpenAI image model"), which separates it from generate_text and generate_speech. It stops short of explicitly contrasting with the closest sibling, edit_image, so an agent must infer the generate-vs-edit boundary from the phrase "from a text prompt".

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 is implied by the tool's nature — call it when you need a new image from a text description — but no when-to-use or when-not conditions and no alternative tools are named. The only routing guidance offered is internal to the tool (path vs base64), not across tools.

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