Skip to main content
Glama

Generate image

generate_image

Generate an image from a text prompt, or edit and combine existing images with masks, region limits, transparent backgrounds, or split layers into separate PNGs.

Instructions

Create an image from a text prompt, or edit or combine existing images when images is given. The result says whether the user can already see the image; follow it. Write a specific prompt: subject, setting, composition, style, lighting, and any exact text in quotes. For edits, say what changes and what must stay the same. Make one image unless the user asks for more: every image costs them money. When the user asks for several different images at once, make ONE call with prompts (one prompt per image), never several calls: they then appear together as one gallery. When the user asks to split or separate an image into layers, or to get its elements as separate transparent PNGs, call this with layers: true and that one image.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
outNoWhere to save, as a file path or a folder ending in "/". Only when the server runs on the user's machine. Default: generated-images/ in the project.
maskNoLimits an edit to part of the first image: a PNG the same size as it, transparent where the change may happen. Usually the id from the card's Select area tool.
sizeNoExact pixels as WIDTHxHEIGHT, for example 1536x1024. Use aspect or size, not both.
countNoVariants of this one prompt. Default 1.
eraseNoWith mask or edit_regions: remove whatever is in that area and fill it in to match its surroundings. The card's Erase tool asks for this.
modelNoA model id from list_image_providers. Omit for the provider's default.
aspectNoShape as W:H, for example 1:1, 16:9, 9:16, 4:5, 3:2.
imagesNoImages to edit or use as references. Omit to create from text alone.
layersNoSplit exactly one input image (by `images` or `selection: true`) into a base plus separate transparent PNG layers, one per element (Seedream only; runs on the whole image, so no mask or edit_regions; `prompt` is optional and may say how to split it). Billed per image returned, usually about 5.
promptNoWhat to make. For edits: what to change and what to keep.
promptsNoSeveral different images in one go, one prompt each, shown together as one gallery. Use this in place of `prompt` when the user asks for more than one distinct image (for example an apple, a pear and cherries). For takes on a single prompt use `count`.
qualityNoLeave this out unless the user asks for more quality: the default is the fast one. medium for a finished image, high for the finest detail; both are slower.
fidelityNoFor edits with openai gpt-image-1.5: high keeps faces, logos and fine detail of the inputs closer to the original.
providerNoOmit to use the user's default provider.
selectionNoEdit the image the user has open in the image card, limited to the area they painted on it if any. Use it when a message says "this image" or "the selected area" without an id; leave out `images`, `mask` and `erase`.
backgroundNotransparent needs provider openai with model gpt-image-1.5.
edit_regionsNoLimits an edit to rectangles of the first image, without needing a mask file. Each is fractions of the image from its top-left corner, for example the top third is { "x": 0, "y": 0, "width": 1, "height": 0.33 }. Supported by provider openai.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description itself supplies important side-effect and result-handling context: every image costs the user money, batched prompts appear together as one gallery, and the agent must follow the result's statement about whether the user can already see the image. It adds little about retrieval, failures, or persistence, so its behavioral disclosure is strong rather than exhaustive.

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 front-loads the core purpose, then logically covers result handling, prompt quality, cost and default behavior, batching, and the layer-splitting case. At roughly 150 words for a 17-parameter tool, it is dense but efficient, with each sentence supplying an actionable rule.

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 complex tool, it covers all primary invocation modes and the most consequential cost and batching decisions, while the fully described schema handles advanced mask, provider, sizing, and output-path options. The visibility instruction partially compensates for the absent output schema, giving the agent enough guidance to invoke the tool and handle its result correctly.

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?

Although schema coverage is 100%, the description adds practical prompt semantics—subject, setting, composition, style, lighting, and quoted exact text—and explains that edits should state both changes and invariants. It also reinforces selection among `images`, `prompts`, and `layers`, though some of that routing restates the already-detailed schema.

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 opening sentence gives a specific verb and resource and distinguishes three modes: text-to-image creation, editing, and combining existing images via `images`. The final sentence further identifies the layer-splitting and transparent-PNG mode, making the scope easy to distinguish from retrieval or layer-management siblings.

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?

It gives explicit routing rules: use a text prompt for creation, `images` for edits or combinations, one batched `prompts` call for several distinct images, and `layers: true` with one input for separation requests. "Make one image unless the user asks for more" and "never several calls" provide a clear default and an explicit anti-pattern.

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