Skip to main content
Glama

Generate image with AI

generate_image

Generate an image from a text prompt (1-1000 chars) and save it to the media library. aspect: 1:1 (default), 4:5, 9:16, 16:9 or 1.91:1. Returns id, url and mediaType; pass the url in mediaUrls of create_post / create_draft_post. Requires the MEDIA_WRITE scope. Limited by a monthly quota: HTTP 429 means it is spent, do not retry right away. 502 is a provider failure and can be retried; 503 with code FEATURE_DISABLED means AI images are not enabled on this deployment, never retry and use another media option; 422 means the prompt was rejected or storage quota is full.

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
aspectNo1:1
promptYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses the required MEDIA_WRITE scope, a monthly quota, and precise retry semantics per error code (429 do not retry, 502 retryable, 503 FEATURE_DISABLED never retry, 422 prompt rejected or storage full). It also states side effects (saved to media library) and the return fields.

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?

Front-loaded with the core action and output, then error handling in a compact code-by-code sequence; nearly every clause carries operational information. The only mild redundancy is repeating the prompt length and aspect values already present in the schema.

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 two-parameter generation tool with no annotations and no output schema, the description covers auth, quota, failure modes, return shape, and next-step integration. The only shortfall is that fallback behavior in both the 'use another media option' and quota-exhausted cases is left unnamed.

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 description coverage is 0%, so the description must compensate, and it only restates what the schema already encodes: the 1-1000 char prompt bound and the aspect enum values plus default. It adds no meaning about what each aspect ratio is for (e.g., which suits vertical story formats), which is the one piece of guidance the bare enum cannot convey.

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 an image from a text prompt and save it to the media library' — which is unambiguous and distinct from the media-related siblings (list_media, search_stock_photos, upload_media). It even names the downstream destination (create_post / create_draft_post) so the agent knows this is the AI-generation path rather than an upload path.

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?

Clearly frames the workflow: generate, then pass the returned url in mediaUrls of create_post / create_draft_post. It also gives conditional guidance for the FEATURE_DISABLED case ('use another media option'), though it does not name which sibling to fall back to, and it never explicitly excludes stock-photo or upload paths.

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