Skip to main content
Glama

Generate images with Grok Imagine

grok_generate_image

Generate images with Grok Imagine from text prompts through your logged-in Chrome session—no API key required. Set aspect ratio, size, and batch count within daily quota limits.

Instructions

Generate images with Grok Imagine in the user's logged-in Chrome (no API key; uses the user's own Grok plan and daily quota: see grok_usage(); jobs over the limits are refused).

Omitted aspect / n / mode / timeout_s use the configured defaults (see grok_settings). aspect: 16:9 | 9:16 | 1:1 | 2:3 | 3:2. n: images to keep, 1..4 (one submission gives 2; n=3/4 = 2 submissions). mode: "speed" | "quality" (a warning, not a failure, if the page control is not found). max_side: shrink saved files so the long side <= max_side (e.g. 1344). size: exact "WxH" (e.g. "1344x768"), scale to cover + center crop (overrides max_side). keep_original: also keep _orig.. out_dir: absolute, or relative to the output root (GROK_WEB_MCP_OUTPUT_DIR, default ~/grok-web-mcp). Files are _1.jpg, _2.jpg ... (never overwritten). Returns {"files", "kept", "generated", "submissions", "aspect_ok", "secs", "sizes"?, "warning"?}.

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

Input Schema

NameRequiredDescriptionDefault
nNo
modeNo
nameNo
sizeNo
aspectNo
promptYes
out_dirNo
max_sideNo
timeout_sNo
keep_originalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already flag non-readonly, non-idempotent, open-world behavior; the description adds substantial value beyond them: it discloses auth model (browser session, no API key), quota-enforcement refusal, that missing page controls yield a warning rather than failure, and that output files are never overwritten. That is exactly the behavioral context an agent needs before spending the user's quota.

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?

Dense but front-loaded: environment/auth context first, then parameter rules, then file naming and return shape. Nearly every clause earns its place, though the parameter block reads as a run-on list and could be marginally tighter.

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?

With no output schema, the description correctly documents the return object keys (files, kept, generated, submissions, aspect_ok, secs, sizes, warning) and the on-disk naming convention. Combined with defaults and quota behavior, an agent has everything needed to invoke and interpret results.

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 coverage is 0% with 10 parameters, so the description carries the full burden and does: enumerates aspect ratios, n's 1..4 range and the 2-images-per-submission mechanic, mode values, max_side semantics, size's exact WxH with cover+crop behavior and override relationship, keep_original, and out_dir resolution. It also names which parameters fall back to grok_settings defaults.

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?

States a specific verb and resource (generate images with Grok Imagine) plus the execution context (user's logged-in Chrome, no API key). This clearly separates it from grok_generate_video and the other sibling tools like grok_usage/grok_settings.

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?

Gives operational context: quota-backed via the user's own plan, jobs over limits are refused, and points to grok_usage() and grok_settings for limits/defaults. It does not explicitly say when to prefer grok_generate_image over grok_batch or grok_generate_video, so it stops short of full alternatives routing.

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