Skip to main content
Glama

generate_image

Create or edit an image from a text prompt, returning a temporary URL and a preview. Use it to turn text descriptions into visual assets or modify an existing image.

Instructions

Generate an image from a text prompt (or edit an input image). Returns the URL(s) of the generated image, valid 7 days, plus a downscaled preview of the image itself when the client can show tool-result images to you. If you cannot see the image in the result, call review_image with the returned URL to get a written critique and a revised prompt, then generate again. Roughly $0.025 per image on the default model; gpt-image-2-lite is $0.008.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoImage model id, e.g. gpt-image-2, gpt-image-2-lite (cheapest), gemini-3-pro-image, gemini-2.5-flash-image, doubao-seedream-4-5-251128.gpt-image-2
promptYesText description of the image to generate.
image_urlNoOptional input image for image-to-image edits. Accepts a public https:// URL, a LOCAL FILE PATH, a localhost URL, or a data: URI — local sources are uploaded for you automatically.
resolutionNoOptional resolution, e.g. 1K, 2K, 4K.
aspect_ratioNoOptional aspect ratio, e.g. 1:1, 16:9, 9:16.
return_imageNoAttach a downscaled preview (max 1024px JPEG) of the result so you can look at it. Set false to save context when you only need the URL.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.6/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 of behavioral disclosure. It discloses that URLs expire after 7 days, that a downscaled preview may be attached, that generation is not free (with approximate costs), and that review_image should be used as a fallback when the image cannot be seen. This is substantial, useful behavioral context.

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 three sentences with no filler: purpose first, then output behavior, then fallback workflow and cost. Every sentence contributes actionable 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?

The tool is reasonably complex with 6 parameters and no output schema, and the description still explains return values, URL lifetime, preview behavior, costs, and the follow-up workflow. It is slightly shy of full completeness because it does not describe failure modes or edge cases, but it is sufficient for correct invocation in most cases.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3, but the description adds value by explaining cost tradeoffs between models and the practical meaning of returning vs. previewing images. This goes beyond the raw schema descriptions for model and return_image.

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 states a specific action ('Generate an image from a text prompt') and immediately covers the alternate mode ('or edit an input image'), clearly distinguishing the tool from siblings like generate_video and review_image. The verb and resource are unambiguous.

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

Usage Guidelines4/5

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

The description gives explicit guidance for the review_image alternative: if the agent cannot see the result, call review_image with the URL and use its revised prompt. It also provides model-cost guidance for choosing gpt-image-2-lite, though it does not explicitly discuss when to prefer generate_video or chat.

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