Skip to main content
Glama

generate_image

Create new images or modify existing ones using text prompts and visual references with Grok Imagine's AI models.

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"`.

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

Input Schema

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

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

With no annotations provided, the description carries full burden and does well. It discloses: the tool can both generate and edit images, multiple references are combined in a single call, supported file formats (JPG/PNG), image count range (1-10), and output format options. It doesn't mention rate limits, authentication needs, or cost implications, but covers core behavioral aspects.

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 and appropriately sized. It starts with the core purpose, then explains usage patterns, followed by a clear 'Args:' section with parameter details, and ends with return information. Every sentence earns its place with no redundancy or fluff.

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?

For a complex 8-parameter tool with no annotations and no output schema, the description is quite complete. It covers purpose, usage, all parameters, and return format. The main gap is lack of explicit error conditions or limitations (like maximum image size, processing time). Given the complexity, it's strong but not fully exhaustive.

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 fully compensates by providing detailed parameter semantics. It explains each parameter's purpose: prompt as 'description or edit instruction', model options, image_paths/image_urls usage, n range, image_format options, aspect_ratio examples, and resolution options. This adds significant value beyond the bare schema.

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 specifies the verb ('generate'/'edit'), resource ('images'), and technology ('Grok Imagine'). It distinguishes from siblings like generate_video by focusing on images, and from chat tools by being an image generation/editing tool.

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 context: 'Pass `image_paths` and/or `image_urls` to edit images or use them as visual references.' It explains when to use references vs. pure generation. However, it doesn't explicitly state when NOT to use this tool or name specific alternatives among siblings (like when to use generate_video instead).

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