Skip to main content
Glama

Generate image

generate_image

Turn text prompts into image files saved to disk, returning paths and token usage for easy use.

Instructions

Generate images from a text prompt with OpenAI GPT Image 2.5. Saves files to disk and returns paths and token usage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoNumber of variations to generate; each costs output tokens. Files get -1, -2 suffixes. Default 1.
sizeNoauto | 1024x1024 | 1536x1024 | 1024x1536 | WIDTHxHEIGHT (multiples of 16, ratio 1:3..3:1, max edge 3840). Overrides aspect_ratio. Default auto.
modelNoflare = fast, general purpose. sunburst = slower, higher precision. Same price. Default flare.
promptYesImage description, or the change to make when editing.
qualityNoHigher = more detail, more output tokens. auto lets the model choose (may be costly). Default auto.
file_nameNoBase name without extension. Default timestamp + prompt slug.
long_edgeNoLonger side in px, used with aspect_ratio. Default 1536.
backgroundNotransparent needs png or webp. Default auto.
moderationNoOpenAI content filter. low refuses fewer borderline prompts. Default low.
output_dirNoSave directory. Default IMAGEN_OUTPUT_DIR env or ./output (relative to server cwd).
aspect_ratioNoComputes size together with long_edge. Default none.
return_imageNoAlso return the image inline (base64, ~1.4 MB per 1024x1024 png) so it can be viewed. File is saved either way. Default false.
output_formatNoAlso the file extension. Default png.
output_compressionNojpeg/webp quality like JPEG: lower = smaller file, more artifacts. Default 100.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
sizeYes
filesYes
modelYes
usageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

The annotations already indicate this is a non-read-only, non-idempotent operation. The description adds useful behavioral detail by disclosing that files are saved to disk and that paths and token usage are returned. It does not cover overwrite behavior or authentication requirements, but it goes beyond the annotations without contradiction.

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?

The description is two short sentences with no filler. The core purpose is front-loaded, and the side-effect and return information are stated compactly.

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 a complex 14-parameter tool, the description gives the essential context: generation from a prompt, file saving, and return values. With a full input schema and an output schema present, the description is mostly sufficient, though it could add high-level guidance on model/quality tradeoffs or when editing is the better choice.

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 input schema already fully documents all 14 parameters. The description adds no parameter-specific semantics beyond the model name, which makes the baseline 3 appropriate.

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 starts with a specific action, 'Generate images from a text prompt with OpenAI GPT Image 2.5', which clearly names the verb and resource. It also states the tool saves files and returns paths and token usage, but it does not explicitly name or differentiate against the sibling edit_image tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance on when to use this tool versus alternatives such as edit_image. It implies a text-to-image generation context, but does not state when not to use it, mention the editing sibling, or give selection criteria.

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