Skip to main content
Glama

generate_image

Generate or edit images using a text prompt. Optionally provide existing images as references or sources for edits.

Instructions

Generate new images or edit existing ones with Grok Imagine.

Pass `image_paths` and/or `image_urls` to edit images or use them as
visual references. Multiple references are combined in a single call.

Args:
    prompt: Image description, or the edit instruction when references are provided.
    model: Image model (`grok-imagine-image` or `grok-imagine-image-pro`).
    image_paths: Local image files (JPG/PNG) used as edit sources or references.
    image_urls: Public image URLs used as edit sources or references.
    n: Number of images to generate (1–10).
    image_format: `"url"` (default) or `"base64"`.
    aspect_ratio: Aspect ratio like `"16:9"`, `"1:1"`, or `"9:16"`.
    resolution: `"1k"` or `"2k"`.
    show_usage: Append a token usage and cost footer to the result (default False).

Returns:
    Markdown block with each generated image URL and any revised prompt.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
modelNogrok-imagine-image
promptYes
image_urlsNo
resolutionNo
show_usageNo
image_pathsNo
aspect_ratioNo
image_formatNourl
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses editing capability, combination of references, and return format (Markdown with URLs and revised prompt). Could mention if any side effects or auth requirements, but transparent enough.

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 well-structured with Args and Returns sections, and each sentence adds value. No fluff, easy to parse.

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?

Despite 9 parameters and no output schema, the description covers all param uses, the edit vs generate distinction, and the return format. Complete for an image generation tool.

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?

With 0% schema description coverage, the description adds full meaning to each parameter, including purpose, defaults, and examples (e.g., '16:9'). Slightly imprecise for enums (e.g., resolution only says '1k' or '2k'), but sufficient.

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 or edits images using Grok Imagine, with specific explanation of how references work. No sibling tools do this, so it is well-differentiated.

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?

It explains when to use image_paths/image_urls for editing and that multiple references are combined. It implicitly covers when to generate vs edit. Could be more explicit about not using for other tasks, but adequate.

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/merterbak/Grok-MCP'

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