Skip to main content
Glama
Grok Imagine Image MCP Server

Grok Imagine Image MCP Server

by ex-takashima

generate_image

Create images from text prompts, generating up to 10 per request with Grok models, multiple aspect ratios, and 1k or 2k resolution. Set quality, model, and output path for each batch.

Instructions

Generate a new image from a text prompt using xAI Grok Imagine Image API. Models: grok-imagine-image ($0.02/image at 1k or 2k), grok-imagine-image-pro ($0.05/image at 1k, $0.07/image at 2k), grok-imagine-image-2.0 (latest, $0.04-$0.08/image depending on resolution and quality). Supports aspect ratios: 1:1, 3:4, 4:3, 3:2, 2:3, 2:1, 1:2, 9:16, 16:9, 19.5:9, 9:19.5, 20:9, 9:20, auto. Can generate multiple images at once (up to 10).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "prompt": "<prompt>"
    },
    "name": "generate_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
nNoNumber of images to generate (1-10, default: 1)
modelNoModel to use (default: grok-imagine-image $0.02/image; pro $0.05/image at 1k, $0.07 at 2k; 2.0 $0.04 at 1k-low, $0.06 at 2k-low, $0.06 at 1k-medium, $0.08 at 2k-medium)
promptYesThe text prompt describing the image to generate
qualityNoQuality tier. Only supported by grok-imagine-image-2.0 (default: medium)
resolutionNoResolution of the generated image (default: 1k)
output_pathNoOutput file path (default: generated_image.jpg)
aspect_ratioNoAspect ratio (default: 1:1)
return_base64NoReturn base64 image data in response (default: false)
include_thumbnailNoInclude thumbnail preview in MCP response for LLM recognition (default: false, overrides XAI_IMAGE_THUMBNAIL env var)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose cost per model/resolution, a hard cap of 10 images, and the supported aspect ratios. It says nothing about auth requirements, whether output_path overwrites existing files, or how the response is shaped (file vs base64 vs thumbnail), which matters for a tool that writes to disk.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The lead sentence is front-loaded and useful, but the remaining text enumerates all 14 aspect ratios and re-states per-model pricing already present in the schema enum descriptions. Those lists crowd out information the schema does not already provide.

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?

For a 9-parameter, no-annotation tool with no output schema, the description covers cost and volume but omits the return behavior — critical given output_path, return_base64, and include_thumbnail all imply different response shapes. Adequate for picking a model, incomplete for a confident call.

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

Parameters3/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. The description reinforces the cost implications of resolution/model combinations, but it largely repeats the schema's own model enum documentation and lists every aspect ratio value verbatim, adding little meaning beyond the structured fields.

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 first sentence names a specific verb and resource ('Generate a new image from a text prompt') plus the backing API, which implicitly contrasts with the sibling edit_image. It stops short of an explicit sibling differentiation, but an agent can still tell generation apart from 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?

Usage is only implied: 'generate a new image' versus an edit workflow. The pricing and capability notes (quality only on 2.0, resolution affecting cost) give practical selection guidance for models, but there is no explicit statement of when to prefer this over edit_image or when generation is inappropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools