Skip to main content
Glama

generate_image

Generate images from text prompts, save them to the generated-assets directory, and return previews. Use for new images without a reference; for edits, use edit_image.

Instructions

Generate one or more brand-new images from a text prompt using OpenAI's image model, save them as files in the project's generated-assets directory, and return a small preview of each. Use this when no existing image needs to guide the result. If you need the new image to match the look of images you already have (a brand board, an earlier asset, a photo to modify), use edit_image instead and pass those files as references. Write prompts as a full description: subject, style, composition, lighting, colour palette, and any text that must appear. SIZE: pass a preset name or explicit WIDTHxHEIGHT. Presets: 'square' (1024x1024), 'landscape' (1536x1024), 'portrait' (1024x1536), 'hero' (1920x1088), 'banner' (1536x512), 'auto' (model picks). Explicit sizes are rounded to the nearest multiple of 16 (minimum 256); the aspect ratio must be between 1:3 and 3:1 and neither side may exceed 3840. The result text reports the size actually produced, so check it if the exact pixel size matters. BACKGROUND: 'transparent' produces an alpha channel and requires output_format 'png' or 'webp' (never 'jpeg'); use it for logos, icons and cut-out illustrations. QUALITY: 'low' is fast and cheap (good for drafts and iteration), 'high' is slow (can take over a minute) and detailed; 'auto' lets the model choose. RETURNS: for each image, a text block with the absolute file path, final width x height, model, quality and the path of a .json sidecar holding the prompt and settings, followed by a small JPEG preview (longest side 512px) so you can inspect the result. The full-resolution file is already on disk; reference it by the returned path (for example as a site asset).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoHow many variations to generate (1-4).
sizeNoPreset name (square, landscape, portrait, hero, banner, auto) or WIDTHxHEIGHT.square
promptYesFull description of the image to create.
qualityNoauto, low (fast draft), medium, or high (slow, detailed).auto
filenameNoOptional file name without extension. Defaults to a slug of the prompt plus a timestamp. Never overwrites: a taken name gets -2, -3, ...
backgroundNoauto, opaque, or transparent (transparent requires png or webp).auto
output_formatNoFile format: png, jpeg, or webp.png

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and meets it impressively. It discloses concrete side effects: files land in the generated-assets directory, a .json sidecar is written, and 'a taken name gets -2, -3, ...' (never overwrites). It reveals timing behavior ('high' can take over a minute), size-correctness caveats (rounded to multiples of 16, aspect-ratio bounds, result text reports actual size), and transparency/format coupling. It also states the return contract in detail, compensating for the missing output schema.

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 long but every sentence earns its place; there is no filler. It is front-loaded with purpose and usage routing, then uses labeled SHOUTED sections (SIZE, BACKGROUND, QUALITY, RETURNS) that make dense parameter logic scannable. The closing note about referencing the saved path tells the agent what to do with the result, closing an otherwise easy-to-miss loop.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter tool with no annotations and no output schema, the description is complete. It covers the operation, side effects (file writes, sidecar), parameter semantics with constraints, timing expectations, and a detailed return contract (absolute path, dimensions, model, quality, preview). Nothing an agent needs to invoke it correctly and interpret results is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds substantial meaning beyond the schema: exact pixel dimensions for every size preset, rounding-to-16 rules, the 1:3–3:1 aspect-ratio bound, and the 3840-pixel maximum are absent from the schema. It adds the transparent-requires-png/webp constraint, explains quality trade-offs (low = fast/cheap for drafts, high = slow over a minute), and the filename never-overwrite behavior. This goes well beyond the baseline 3 justified by full schema coverage.

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 opens with a specific verb and resource: 'Generate one or more brand-new images from a text prompt... save them as files... return a small preview.' It explicitly contrasts with edit_image ('if you need the new image to match the look of images you already have'), so an agent can distinguish create-from-prompt from edit-from-reference without opening schemas. The phrase 'brand-new' signals no input image is required, which is the core differentiator.

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

Usage Guidelines5/5

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

Provides an explicit when/when-not rule: 'Use this when no existing image needs to guide the result. If you need the new image to match the look of images you already have... use edit_image instead and pass those files as references.' This names the sibling alternative and the exact condition that selects it — nothing is left to inference. The prompt-writing guidance (subject, style, composition, lighting, colour palette, text) is also actionable.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mostmark/openai-image-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server