Skip to main content
Glama

Generate image from text

text-to-image

Generate an image from a text prompt using Gemini, Grok, GPT-image, or impossibl.com, then save the result to disk.

Instructions

Generates an image from a text prompt using Gemini, Grok Image, GPT-image, or impossibl.com, and saves it to disk.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNoNumber of images to generate. Default 1.
sizeNoProvider-specific size string, e.g. "1024x1024".
modelNoSpecific model id. Defaults to that provider's latest non-top-tier model. Call list_image_providers to see options.
promptYesText description of the image to generate.
qualityNoProvider-specific quality hint (e.g. "low"/"medium"/"high" for gpt-image). Defaults to a non-maximum tier.
filenameNoBase filename (without extension) to save the image as.
providerNoWhich image provider to use. REQUIRED when more than one of GEMINI_API_KEY / XAI_API_KEY / OPENAI_API_KEY / IMPOSSIBL_API_KEY is configured and IMAGE_PROVIDER_DEFAULT is not set. In that case: first check your memory for a stored user preference for a default image provider; if there is none, ask the user which provider to use before calling this tool, then remember their answer for future calls.
aspect_ratioNoAspect ratio such as "16:9" (Gemini only).
Behavior3/5

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

No annotations are provided, so the description carries the behavioral disclosure burden. It does state the side effect of 'saves it to disk,' which is meaningful behavioral context. However, it doesn't disclose rate limits, authentication requirements, costs, whether files may overwrite existing files, or failure modes. The schema mentions checking for user preference and asking the user, which helps, but that's schema content, not description.

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 a single, efficient sentence that packs in the verb, resource, providers, and side effect with zero wasted words. It's front-loaded and every element earns its place.

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?

This is a moderately complex tool with 8 parameters and no output schema, but the schema descriptions are rich (100% coverage) and cover the tricky provider-selection logic extensively. The description adds the essential context: providers list and disk persistence. While it could mention that model/quality/defaults differ by provider, the schema already hints at this, so combined coverage is reasonably complete. A note about return/error behaviors would push this higher.

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 coverage is 100%, so the baseline is 3, and the description adds value beyond the schema by naming the concrete providers and noting the disk-save behavior. The descriptions add the cross-reference to list_image_providers for discovering model options, which complements the schema. For a high-coverage schema, the description provides useful extra framing about provider-specific defaults without duplicating schema content.

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?

The description clearly states the action (generates an image from a text prompt), names the four available providers, and notes it saves to disk. It distinguishes itself from the sibling image-to-image tool since it specifies 'from a text prompt.' However, it doesn't explicitly contrast with siblings, and 'using Gemini, Grok Image, GPT-image, or impossibl.com' is somewhat redundant given the provider enum in the schema.

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 text-to-image generation without explicit when-to-use or when-not-to-use guidance versus the sibling image-to-image tool. The provider parameter's schema provides substantial context about asking the user which provider to use, but that's structured data rather than description content. No explicit guidance on when to choose this over alternatives or prerequisites is given in the description itself.

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/danton721/imagengen'

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