Skip to main content
Glama

generate_image

Generate a 2D image from a text prompt (async). Returns an asset { id }; then call wait_for_asset (or poll get_asset) until taskStatus=2 and read files.image (PNG URL). Costs credits — see list_models(category='image').

Instructions

Generate a 2D image from a text prompt (async). Returns an asset { id }; then call wait_for_asset (or poll get_asset) until taskStatus=2 and read files.image (PNG URL). Costs credits — see list_models(category='image'). Omit model for the default. Up to 4 reference image URLs can guide the result (best with nano-banana).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoengine name from list_models(category='image')
promptYes
aspect_ratioNoW:H, e.g. "1:1", "16:9", "9:16", "21:9". Use a value from the model's supportedAspectRatios in list_models(category='image') — nano-banana models reject anything else with 400 before charging credits; gpt-image-* buckets any ratio to its nearest of three output sizes.
reference_image_urlsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.6
    • changedInput schema / properties / aspect_ratio / description
      Previous value: -"e.g. \"1:1\", \"16:9\", \"9:16\""New value: +"W:H, e.g. \"1:1\", \"16:9\", \"9:16\", \"21:9\". Use a value from the model's supportedAspectRatios in list_models(category='image') — nano-banana models reject anything else with 400 before charging credits; gpt-image-* buckets any ratio to its nearest of three output sizes."
    • addedInput schema / properties / aspect_ratio / pattern
      Added value: +"^[1-9]\\d?:[1-9]\\d?$"
    • changedInput schema / properties / prompt / maxLength
      Previous value: -5000New value: +4000
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden. It discloses async behavior, the return shape (asset { id }), the need to poll until taskStatus=2, the output location (files.image PNG URL), and credit costs. This is unusually transparent.

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?

Four dense sentences with no filler. The main purpose is front-loaded, and each sentence adds workflow, cost, model, or reference-image guidance. Every word earns its place.

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?

Despite no output schema and no annotations, the description explains the async lifecycle, return asset ID, polling condition, final PNG URL, credit implications, model selection, and reference-image limits. An agent has what it needs to invoke the tool and handle the result.

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 coverage is only 50%, so the description adds needed meaning: 'text prompt' for prompt, 'guide the result' and 'best with nano-banana' for reference_image_urls, and default model behavior. The schema already covers aspect_ratio and model, so the description compensates for the uncovered params.

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?

States a specific verb ('Generate'), a specific resource ('2D image from a text prompt'), and the async nature. It distinguishes itself from siblings like generate_3d_from_text and generate_3d_from_image by explicitly saying '2D'.

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?

Provides clear context on the follow-up workflow (wait_for_asset/get_asset), credit costs, and how to select models. It does not explicitly exclude 3D or animation alternatives, though the '2D image' phrasing implies the boundary.

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