Skip to main content
Glama

generate

Create images from text descriptions using a text-to-image model. Supports custom dimensions, steps, and seed for reproducible results.

Instructions

Generate an image from a text prompt.

Returns a consistent content array for both stdio and SSE transports:
1. TextContent: Enhanced metadata including generation info and file details
2. ResourceLink: Main image file reference with context-appropriate URI:
   - SSE: Absolute URL built from request context (X-Forwarded-* headers), ZIMAGE_BASE_URL, or relative path
   - Stdio: file:// URI for local access
3. ImageContent: Thumbnail preview (base64 PNG, max 400px)

URI Building Priority (SSE):
1. Context parameter (ctx.request_context.request) - builds absolute URL from request headers
2. ZIMAGE_BASE_URL environment variable - uses configured base URL
3. Relative URL - fallback when no other method available

File metadata (filename, file_path) is in TextContent to avoid duplication in ResourceLink.

For long-running operations (high steps/large images), this function will:
- Send progress notifications at key milestones via ctx.report_progress()
- Handle client disconnections gracefully

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
seedNo
stepsNoNumber of inference steps (max bounded by server config)
widthNoImage width in pixels (max bounded by server config)
heightNoImage height in pixels (max bounded by server config)
promptYes
precisionNoq8

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description fully discloses return structure (three content types), transport-dependent URI building, progress notifications for long-running operations, and client disconnection handling. It is transparent about key behaviors, though it omits side effects or auth requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description front-loads the core purpose and uses structured bullet points for return type details and URI building priority. While somewhat verbose on transport specifics, it is well-organized and each section adds meaningful detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters, no annotations, and existing output schema, the description covers the tool's operation and return structure but lacks constraints on parameter values (e.g., valid ranges for steps/dimensions) and usage examples. It is adequate but not complete.

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

Parameters2/5

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

The schema has 50% description coverage for 6 parameters. The description does not elaborate on any parameter meanings or constraints beyond the schema's own descriptions, failing to add value for the agent's understanding of parameters like seed, precision, etc.

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 begins with a clear statement: 'Generate an image from a text prompt.' This provides a specific verb and resource, and the tool is easily distinguishable from its siblings (list_history, list_models).

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?

The description implies usage for image generation but does not explicitly tell when to use this tool versus alternatives, nor does it provide conditions for not using it. No exclusions or alternative suggestions are given.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/iconben/z-image-studio'

If you have feedback or need assistance with the MCP directory API, please join our Discord server