Skip to main content
Glama

Generate image xAI

generate_image_xai
Destructive

Generate or EDIT an image using xAI Imagine (Quality Mode default = grok-imagine-image-2.0). Photorealistic, illustrations, flat graphics, icons, banners. 1K/2K. Single or multi-image edit (≤5 refs via artifact_ids). MCP/autonomous: artifact_id only — a reference URL is refused before any Allow card. model_tier=standard for cheap drafts; model_tier=auto for 2.0 quality:auto.

Routing: ALL image generation and editing → use this (2 credits). Quality default; multi-ref composite via artifact_ids.

[sensitive-tier — first use may require a manager's approval; a from-now-on approval makes future calls seamless, a just-once approval re-asks next time. Call it on the first clear ask; the card is the yes — do not re-ask in chat.]

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoOptional Media gallery folder to file this image into (freeform name, e.g. "q3-campaign" or "brand-assets"). Shown as a folder chip on the /media page so the operator can find it later. Reuse an existing folder name when the work belongs to it.
promptYesDetailed description of the image. Include lighting, camera angle, environment, style, and subject details.
companyIdYesFreedomOS company id to act within (you must be a member). Required for company-scoped tools.
model_tierNoquality (default, grok-imagine-image-2.0), auto (2.0 quality:auto), or standard (cheaper draft). Prefer quality for customer-facing work.
resolutionNoOutput resolution. 1k (default) or 2k (print/pro).
artifact_idNoID of an existing artifact to edit. Prefer over raw URLs (company-scoped resolve).
folder_nameNoSubfolder name for Drive save (e.g. "Product Shots", "Headshots"). Only used when save_to_drive is true.
artifact_idsNoMultiple artifact IDs for multi-ref edit/composite (max 5).
aspect_ratioNoAspect ratio. Defaults to 1:1. Use "auto" to let the model choose.
save_to_driveNoIf true, also save the image to Google Drive for permanent storage. Defaults to false.
reference_image_urlNoChat door only. MCP/autonomous must pass artifact_id — a URL is refused and never queued as an Allow card.
reference_image_urlsNoChat door only (max 5). MCP/autonomous: artifact_ids.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / artifact_ids / description
      Previous value: -"Multiple artifact IDs for multi-ref edit/composite (max 3)."New value: +"Multiple artifact IDs for multi-ref edit/composite (max 5)."
    • changedInput schema / properties / aspect_ratio / enum
      Previous value: -[
      -  "1:1",
      -  "16:9",
      -  "9:16",
      -  "4:3",
      -  "3:4",
      -  "3:2",
      -  "2:3",
      -  "2:1",
      -  "1:2",
      -  "19.5:9",
      -  "9:19.5",
      -  "20:9",
      -  "9:20",
      -  "auto"
      -]New value: +[
      +  "1:1",
      +  "16:9",
      +  "9:16",
      +  "4:3",
      +  "3:4",
      +  "3:2",
      +  "2:3",
      +  "2:1",
      +  "1:2",
      +  "19.5:9",
      +  "9:19.5",
      +  "20:9",
      +  "9:20",
      +  "21:9",
      +  "5:2",
      +  "auto"
      +]
    • changedInput schema / properties / model_tier / description
      Previous value: -"quality (default, best fidelity) or standard (cheaper draft). Prefer quality for customer-facing work."New value: +"quality (default, grok-imagine-image-2.0), auto (2.0 quality:auto), or standard (cheaper draft). Prefer quality for customer-facing work."
    • changedInput schema / properties / model_tier / enum
      Previous value: -[
      -  "quality",
      -  "standard"
      -]New value: +[
      +  "quality",
      +  "standard",
      +  "auto"
      +]
    • changedInput schema / properties / reference_image_url / description
      Previous value: -"URL of an existing image to EDIT. Prefer artifact_id when possible."New value: +"Chat door only. MCP/autonomous must pass artifact_id — a URL is refused and never queued as an Allow card."
    • changedInput schema / properties / reference_image_urls / description
      Previous value: -"Multiple source image URLs for multi-ref edit/composite (max 3). Prefer artifact_ids."New value: +"Chat door only (max 5). MCP/autonomous: artifact_ids."
  2. Changed8 schema fields changed
    • changedInput schema / properties / artifact_id / description
      Previous value: -"ID of an existing artifact from the MEDIA IN THIS CONVERSATION block. The system will automatically resolve a fresh signed URL from storage. Use this when referencing a previously generated image for editing or animation."New value: +"ID of an existing artifact to edit. Prefer over raw URLs (company-scoped resolve)."
    • addedInput schema / properties / artifact_ids
      Added value: +{
      +  "description": "Multiple artifact IDs for multi-ref edit/composite (max 3).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / aspect_ratio / enum
      Previous value: -[
      -  "1:1",
      -  "16:9",
      -  "9:16",
      -  "4:3",
      -  "3:4",
      -  "3:2",
      -  "2:3",
      -  "2:1",
      -  "1:2",
      -  "auto"
      -]New value: +[
      +  "1:1",
      +  "16:9",
      +  "9:16",
      +  "4:3",
      +  "3:4",
      +  "3:2",
      +  "2:3",
      +  "2:1",
      +  "1:2",
      +  "19.5:9",
      +  "9:19.5",
      +  "20:9",
      +  "9:20",
      +  "auto"
      +]
    • addedInput schema / properties / model_tier
      Added value: +{
      +  "description": "quality (default, best fidelity) or standard (cheaper draft). Prefer quality for customer-facing work.",
      +  "enum": [
      +    "quality",
      +    "standard"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / prompt / description
      Previous value: -"Detailed description of the photorealistic image. Include lighting, camera angle, environment, style, and subject details."New value: +"Detailed description of the image. Include lighting, camera angle, environment, style, and subject details."
    • changedInput schema / properties / reference_image_url / description
      Previous value: -"URL of an existing image to EDIT (instead of generating from scratch). Use a signed URL from the MEDIA IN THIS CONVERSATION block. When provided, the prompt describes the desired changes to apply to this image."New value: +"URL of an existing image to EDIT. Prefer artifact_id when possible."
    • addedInput schema / properties / reference_image_urls
      Added value: +{
      +  "description": "Multiple source image URLs for multi-ref edit/composite (max 3). Prefer artifact_ids.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / resolution / description
      Previous value: -"Output resolution. 1k (default, web quality) or 2k (professional print quality)."New value: +"Output resolution. 1k (default) or 2k (print/pro)."
  3. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations mark destructiveHint=true and readOnlyHint=false, and the description aligns with that. It adds valuable behavioral context beyond the annotations: MCP/autonomous calls must use artifact_id because reference URLs are refused, and the approval card flow is explained (from-now-on vs just-once approvals). This helps the agent anticipate non-obvious system behavior.

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 longer than average but well-structured: core capabilities, routing, then approval behavior. It repeats a few schema facts (1K/2K, ≤5 refs) that could be trimmed, but each section earns its place and the most important routing info is front-loaded.

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 12-parameter, no-output-schema tool, the description covers the key concerns: what the tool does, how to route to it, credit cost, model tier choices, artifact-based editing, and the approval gating. It does not explain the return payload, but that is a minor gap given the rich schema and behavioral notes.

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

Parameters4/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 elevates it by clarifying the critical distinction between artifact_id and reference URLs for MCP/autonomous use, and by adding cost/quality tradeoffs for model_tier. These details are not fully captured by the enum descriptions alone.

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 states a clear verb+resource: 'Generate or EDIT an image using xAI Imagine' and enumerates supported outputs (photorealistic, illustrations, icons, banners) plus resolution and edit modes. It also includes an explicit routing line ('ALL image generation and editing → use this') that distinguishes it from sibling generation tools like generate_vector_image or generate_video.

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?

It gives explicit when-to-use guidance ('ALL image generation and editing → use this') and practical tier selection (standard for cheap drafts, auto for 2.0 quality). The sensitive-tier approval note explains when to invoke and when not to re-ask. It does not name specific alternatives to avoid, but the routing statement is strong enough to guide an agent.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources