Skip to main content
Glama

Generate image (OpenAI)

generate_image

Creates images from text prompts using the OpenAI Images API, with per-call model, size, and quality selection. Saves results to disk and returns file paths for use.

Instructions

Generate images from a text prompt with the OpenAI Images API. Choose the model per call. Images are saved to disk and their paths returned.

Input Schema

NameRequiredDescriptionDefault
nNoNumber of images (1–10). Default 1.
sizeNo"auto", "1024x1024", "1536x1024" (landscape), "1024x1536" (portrait). gpt-image-2 and 2.5 models also accept any WIDTHxHEIGHT: multiples of 16, aspect 1:3–3:1, max 3840x2160 (e.g. "1920x1088", "3840x2160").
modelNoOpenAI image model. Known: gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, gpt-image-1.5, chatgpt-image-latest, gpt-image-1-mini. Dated snapshots (e.g. gpt-image-2-2026-04-21) also work. Default: gpt-image-2.5-flare. Call list_models for capabilities.gpt-image-2.5-flare
promptYesWhat to generate. Describe style in the prompt.
qualityNoDefault "auto". xhigh and max are only on gpt-image-2.5-flare / -sunburst.
backgroundNo"transparent" needs output_format png or webp.
moderationNo"low" = less restrictive filtering.
output_dirNoWhere to save files. Default /root/Pictures/openai-image-mcp.
output_formatNoDefault png.
include_imagesNoAlso return the images inline so the client can display them. Large; off by default.
filename_prefixNoFile name prefix. Defaults to a slug of the prompt.
output_compressionNo0–100, jpeg/webp only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

The description adds meaningful behavior beyond the annotations by noting that images are saved to disk and their paths returned. However, with readOnlyHint=false and openWorldHint=true already flagging a write operation, it does not disclose overwrite behavior, permissions, cost, or rate-limit implications.

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?

Three short sentences with no wasted text: the purpose is front-loaded, then model choice, then output behavior. Every sentence contributes useful 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?

For a 12-parameter write tool with no output schema, the description covers the core purpose and notes that images are saved and paths returned. The schema handles parameter details. Minor gaps like overwrite behavior and cost are not critical to invoking the tool 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 all parameters are already documented in the schema. The description adds only 'Choose the model per call,' which is already covered by the model parameter description, so baseline 3 is 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 states a specific verb and resource: generate images from a text prompt via the OpenAI Images API. It is clear about what the tool does, though it does not explicitly distinguish itself from the sibling edit_image tool beyond the name difference.

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 'Generate images from a text prompt' and 'Choose the model per call,' but there is no explicit guidance on when to use this tool versus edit_image or when not to use it. Alternatives are not mentioned.

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