Skip to main content
Glama

generate_image

Create or edit images using Grok Imagine. Provide a text prompt, specify model and parameters like count, aspect ratio, and resolution to generate images or modify existing ones.

Instructions

Generate new images or edit existing ones with Grok Imagine.

Args: prompt: Image description or edit instruction. model: Image model (grok-imagine-image or grok-imagine-image-pro). image_paths: Local image files 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".

Returns: MediaResult containing image metadata and URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nNo
modelNogrok-imagine-image
promptYes
image_urlsNo
resolutionNo
image_pathsNo
aspect_ratioNo
image_formatNourl

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoHuman-formatted output (includes footers, citations, cost summary).
modelYesActual executing model ID (e.g. 'grok-4.5').
planeNoAPI
routeYesHigh-level route (fast/agentic/research/etc.).
imagesNoGrok Imagine image URLs.
tokensNoTotal tokens consumed.
profileNoInternal routing profile.
summaryNoLegacy/duplicate formatted summary of the media generation.
cost_usdNoExact USD cost from xAI billing metadata.
responseYesRaw model output or primary content.
citationsNoNative xAI/X citations with URL + snippet.
video_urlNo
latency_secNo
duration_secNo
finish_reasonNounknown
imagine_paramsNoOriginal prompt + seed for reproducibility.
reasoning_effortNoGrok 4.5+ native reasoning level.
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It fails to mention any behavioral traits such as rate limits, authentication needs, or potential side effects. The description only covers parameters and return type.

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 as a docstring with an Args section and a Returns section. It is clear and informative, though slightly verbose with all parameters listed individually.

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 the complexity (8 parameters, 1 required) and the presence of an output schema, the description covers the basics but lacks details on error handling, constraints (e.g., allowed aspect ratios), or behavior when parameters are omitted. The return type is mentioned but not fully described.

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?

Schema description coverage is 0%, but the description thoroughly explains all 8 parameters, including their types and default values. It adds significant meaning beyond the schema, particularly for complex parameters like aspect_ratio and resolution.

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's purpose: 'Generate new images or edit existing ones with Grok Imagine'. It distinguishes from sibling tools like generate_video by focusing on image generation/editing.

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?

While the description explains what the tool does, it does not provide explicit guidance on when to use it versus alternatives (e.g., generate_video) or when not to use it. Usage context is implied but not stated.

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/djtelicloud/grok-mcp-server'

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