Skip to main content
Glama

Generate image

generate_image

Create images from text prompts offline with Qwen-Image 2.1. Returns the saved PNG path.

Instructions

Generate an image from a text prompt with the local Qwen-Image 2.1 model. Dimensions are chosen automatically (aspect ratio can be inferred from the prompt, e.g. '16:9 hero image') unless width/height or aspect_ratio are given. Returns the absolute path of the saved PNG. Runs fully offline; typically 45 s–4 min.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNoSeed for reproducible results; omit or -1 for random
widthNoOutput width in pixels (needs height too). Omit to choose automatically.
heightNoOutput height in pixels (needs width too).
promptYesWhat to generate, in natural language
qualityNoAll run Qwen-Image 2.1 Turbo (8 steps): fast = ~1 MP (the default, fastest); balanced = ~1.5K; quality = native 2K (slowest; edits share 2K with their references)
output_pathNoOptional destination (absolute, or relative to the project). Must be inside the project or the app output folder. Existing files are never overwritten; a numbered name is used instead.
aspect_ratioNoAspect ratio such as 1:1, 4:3, 3:4, 16:9, 9:16, or auto (inferred from the prompt)
include_previewNoAlso return a small JPEG preview in the tool result. Default false: images stay local and are not sent to the model.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.9.3

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare non-readOnly, non-idempotent, non-destructive, closed-world, so the safety profile is covered and the description builds on it usefully. It adds genuinely non-schema behavior: runs fully offline, typical runtime of 45 s to 4 min, and returns the absolute path of the saved PNG. It could have noted whether the model must be loaded or whether generation can be cancelled/queued.

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 short sentences, each load-bearing: purpose, dimension defaults, return value, environment/latency. The core action and model are front-loaded, and nothing is restated from the schema.

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?

For a no-output-schema generation tool the description covers the essentials an agent needs: what it produces, where the artifact lands, how long it takes, and that dimensions resolve automatically. Minor gap: it does not mention that the local model may need to be ready or how failures surface, despite a get_generator_status sibling.

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 inference behavior the schema does not: aspect ratio can be parsed from the prompt text (e.g. '16:9 hero image') and dimensions default automatically. That is real added meaning beyond the per-parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Generate an image from a text prompt') and names the backing model (local Qwen-Image 2.1), which differentiates it functionally from the edit/inpaint/upscale siblings that take reference images. It never explicitly contrasts itself with those siblings, so an agent must infer the text-to-image vs image-editing split from the verb alone.

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

Usage Guidelines3/5

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

Usage guidance is parameter-centric rather than routing-centric: it explains that dimensions are auto-chosen unless width/height or aspect_ratio are given, which tells the agent how to call it but not when to prefer edit_image, outpaint_image, or upscale_image instead. No prerequisites (e.g., model availability) are stated, though get_generator_status exists as a sibling.

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