Skip to main content
Glama

Generate Image

generate_image

Create images from text prompts using cloud AI models. Saves each image to disk and returns the file path with a preview.

Instructions

Generate one or more images from a text prompt using a cloud AI model. Every image is saved to disk and its absolute path is returned, along with a small inline preview. Use edit_image instead when starting from an existing image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNoNumber of variations to generate (1-4, parallel requests, billed per image).
modelNoModel slug, e.g. 'google/gemini-2.5-flash-image' or 'openai/gpt-5-image'. Omit to use the configured default. Call list_models to see options.
promptYesDetailed description of the desired result. Be specific about subject, style, lighting, composition.
output_dirNoDirectory to save into (absolute, or ~ for home). Defaults to the configured output directory.
aspect_ratioNoDesired aspect ratio. Support varies by model; treated as a strong hint.
filename_prefixNoShort label used in the saved filename, e.g. 'hero-banner'. Sanitized to letters, digits, dashes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
failedYesError messages for variations that failed
imagesYes
Behavior4/5

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

The description adds key behavioral context beyond annotations: images are saved to disk, absolute path returned, and inline preview. It also hints at billing and parallel requests via parameter comments. But it doesn't fully detail network or model 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 three efficient sentences, front-loading the core purpose and immediately providing the sibling alternative. No excess text.

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?

Given 6 parameters, 1 required, an output schema, and sibling tools, the description and schema together cover usage, constraints, and return values comprehensively. No gaps.

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?

All 6 parameters have descriptions in the input schema (100% coverage), so the description adds no additional parameter info. Baseline 3 is appropriate.

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 clearly states the tool generates images from a text prompt using a cloud AI model, specifies the output (saved to disk with absolute path and preview), and distinguishes it from the sibling edit_image.

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?

The description explicitly says when to use this tool (generate from prompt) and provides a direct alternative ('Use edit_image instead when starting from an existing image'), giving clear usage guidance.

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/legolev/mediamcp'

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