Skip to main content
Glama

text_to_image

Generate images from text prompts using AI, with customizable aspect ratios and prompt optimization, saving files to a specified directory.

Instructions

Generate a image from a prompt.

COST WARNING: This tool makes an API call to Minimax which may incur costs. Only use when explicitly requested by the user.

 Args:
    model (str, optional): The model to use. Values range ["image-01"], with "image-01" being the default.
    prompt (str): The prompt to generate the image from.
    aspect_ratio (str, optional): The aspect ratio of the image. Values range ["1:1", "16:9","4:3", "3:2", "2:3", "3:4", "9:16", "21:9"], with "1:1" being the default.
    n (int, optional): The number of images to generate. Values range [1, 9], with 1 being the default.
    prompt_optimizer (bool, optional): Whether to optimize the prompt. Values range [True, False], with True being the default.
    output_directory (str): The directory to save the image to.
Returns:
    Text content with the path to the output image file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoimage-01
promptNo
aspect_ratioNo1:1
nNo
prompt_optimizerNo
output_directoryNo
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by warning about API costs and specifying that it saves files to an output directory. However, it doesn't mention other important behavioral aspects like rate limits, error handling, or whether the operation is idempotent. The cost warning and file-saving behavior are valuable additions beyond basic functionality.

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 is well-structured with clear sections: purpose statement, cost warning, parameters, and return value. Each sentence earns its place, though the parameter documentation is quite detailed (which is necessary given the poor schema coverage). The front-loaded purpose statement and cost warning are particularly effective.

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?

Given the complexity (6 parameters, no annotations, no output schema), the description does a good job of providing necessary context. It explains parameters thoroughly, warns about costs, and describes the return value. However, it could benefit from more behavioral context (like error conditions or performance characteristics) to be fully complete for a tool with external API dependencies.

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

Parameters5/5

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

With 0% schema description coverage, the description compensates excellently by providing detailed parameter information in the Args section. It explains each parameter's purpose, valid value ranges, and default values. This adds significant meaning beyond what the bare schema provides, making it easy for an AI agent to understand how to use each parameter correctly.

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 tool's purpose: 'Generate a image from a prompt.' This specifies the verb ('generate') and resource ('image'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'generate_video' or 'text_to_audio' beyond the obvious image vs. audio/video distinction.

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?

The description provides clear usage guidance with the 'COST WARNING' section, explicitly stating when to use it ('Only use when explicitly requested by the user') and warning about API costs. This is helpful context for an AI agent. However, it doesn't mention when to choose this tool over alternatives like 'generate_video' for visual content generation.

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/swesmith-repos/MiniMax-AI__MiniMax-MCP.aa97ac39'

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