Skip to main content
Glama
Grok Imagine Image MCP Server

Grok Imagine Image MCP Server

by ex-takashima

edit_image

Modifies existing images from prompts via xAI Grok Imagine, accepting file paths, base64 data, or URLs and supporting up to three source images per request.

Instructions

Edit an existing image using xAI Grok Imagine Image API. Models: grok-imagine-image ($0.02/image + $0.002/input image), grok-imagine-image-pro ($0.05/image at 1k or $0.07 at 2k + $0.01/input image), grok-imagine-image-2.0 ($0.04-$0.08/image + $0.01/input image). Provide a source image via file path, base64, or URL along with a prompt describing the desired changes. Supports up to 3 input images via image_paths/image_base64s/image_urls arrays.

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": "edit_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
nNoNumber of edited images to generate (1-10, default: 1)
modelNoModel to use (default: grok-imagine-image)
promptYesDescription of the desired edits to make to the image
qualityNoQuality tier. Only supported by grok-imagine-image-2.0 (default: medium)
image_urlNoURL of the source image to edit (single image)
image_pathNoPath to the source image file to edit (single image)
image_urlsNoURLs of source images to edit (max 3)
resolutionNoResolution of the output image (default: 1k)
image_pathsNoPaths to multiple source image files to edit (max 3)
output_pathNoOutput file path (default: edited_image.jpg)
aspect_ratioNoAspect ratio for multi-image editing (overrides auto-detection from input image)
image_base64NoBase64 encoded source image to edit (single image)
image_base64sNoBase64 encoded source images to edit (max 3)
return_base64NoReturn base64 image data in response (default: false)
include_thumbnailNoInclude thumbnail preview in MCP response for LLM recognition (default: false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.4.0

TDQS

A3.5/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 behavioral burden. It does add genuinely useful context — per-model pricing and a 3-input-image cap — but omits what happens on failure, that output_path defaults to writing edited_image.jpg (a potential overwrite), and whether the call is idempotent or rate-limited.

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?

Three sentences, front-loaded with purpose and models. The pricing clause is dense but earns some place as cost guidance; nothing is redundant enough to be removed.

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 15-parameter tool, the description covers model choice, input mechanisms, and cost. The main gap is the return side — with no output schema and return_base64/include_thumbnail/output_path parameters, it never explains what the response contains, though the thumbnail parameter's own schema text partially covers that.

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 input schema already documents all 15 parameters including enums and defaults. The description only restates the three input-passing mechanisms and the max-3 array limit, adding little beyond the schema; baseline 3 applies.

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 gives a specific verb+resource ("Edit an existing image") plus the underlying API, and the third specifies the required inputs. It implicitly separates itself from generate_image by requiring a source image, but never names the sibling explicitly.

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?

It states what inputs to supply (source image plus prompt) but never says when to choose this over generate_image, nor any when-not conditions. Usage is implied by the word "edit" rather than spelled out.

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