Skip to main content
Glama

Generate or edit an image

generate_image

Generate or edit images from text prompts, using any OpenAI-compatible provider, and store output images to disk for later use.

Instructions

Generate an image, or edit existing images, via an OpenAI-compatible provider.

Model selection

model accepts three forms:

  • provider:model — explicit, e.g. openrouter:google/gemini-3.1-flash-image-preview, openai:gpt-image-1, xai:grok-imagine-image-2.0. Fastest and unambiguous.

  • a bare model id — searched across every configured provider's catalogue (run list_models first). Ambiguous ids raise an error listing candidates.

  • an alias — defined in providers.json (e.g. nb2).

If omitted, the configured default model is used.

Editing

Pass input_image_path (and optionally input_image_paths) and the prompt becomes an edit instruction. Requirements vary by provider.

Output

Images are always written to disk and their paths returned. Set return_image_content=true to additionally embed the images in the tool result so the model can look at them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
seedNo
sizeNo
modelNo
promptYes
qualityNo
timeout_sNo
backgroundNo
extra_bodyNo
output_pathNo
aspect_ratioNo
output_formatNo
filename_prefixNo
input_image_pathNo
input_image_pathsNo
return_image_contentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Adds meaningful behavioral detail beyond the annotations: images are always written to disk, paths are returned, return_image_content can embed results for the model, ambiguous models raise an error, and provider requirements vary. This gives an agent a clear picture of side effects and output behavior.

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 well-organized with clear sections for model selection, editing, and output. Every section earns its place, and the most action-critical information is front-loaded. It is longer than average but appropriately so for a tool with this many parameters and modes.

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 description covers the core usage modes, output behavior, and model-selection nuances well. With no output schema and only sparse annotations, it leaves some parameter semantics to inference, but the most important behavioral and decision-relevant context is present. A small gap remains for the unmentioned parameters.

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 0%, so the description must carry the parameter-semantics burden. It explains model, prompt, input_image_path(s), output_path, and return_image_content well, but leaves most of the other 16 parameters (n, seed, size, quality, background, extra_body, etc.) undocumented. The value added is solid but incomplete given the parameter count.

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 verb and resource: generating or editing images through an OpenAI-compatible provider. It clearly distinguishes this from the sibling tools, which are all provider/model management operations rather than image operations.

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 concrete usage guidance: how to specify models, when aliases are valid, and to run list_models first for bare model ids. It also explains the edit mode via input_image_path. It does not explicitly discuss when not to use the tool, but the sibling tools are different enough that no exclusion is strictly needed.

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