Skip to main content
Glama

Generate (or edit) an image with AI

generate_image

Generate an image from a text prompt and return a durable public URL ready to pass to create_post as media. To change an image you already have, edit_image is the direct route (image plus instruction); baseImageUrl here does the same edit when it also needs an aspect ratio, product photos or characters. Synchronous: the URL comes back in the same call. Costs 20 AI credits per image, or 40 when reference images are attached (from the monthly pool, see get_image_quota; nothing with the organization's own key, and nothing if it fails). If the workspace speaks as a person or a character and has reference images on file, they are attached so the result looks like them — that is why some images cost more than others. By default a character appears in every image and a person only in photo-like images; set speaker when you know. Write the prompt following get_shot_guide (image_people, image_scene, image_product or place); with shot the server composes it and checks the minimum fields. SPENDS AI CREDITS ONLY WITH confirm: true. Call it first without confirm: nothing runs and nothing is charged, you get the quote (what it will do and the credits). Tell the user, in your own words, exactly that — including the options you chose, so they can change them — and wait for a clear yes before calling again with the same arguments and confirm: true. One yes covers the plan they approved (e.g. every line of an approved voice-over with the chosen voice); anything new or different needs a new yes.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
shotNoOptional structured shot: the server composes the prompt from it (after `prompt`, if any) and checks the minimum fields of its type (get_shot_guide).
aspectNoAspect ratio of the image: 3:4 for Instagram/TikTok/Pinterest feed posts and carousels, 9:16 for stories and reels, 1:1 for X/LinkedIn/Facebook, 16:9 for landscape. Omit to let the model infer it from the prompt.
promptNoWhat to draw, in detail: subject, style, composition, colours, aspect. Vague prompts give generic images. Optional with `shot`.
confirmNotrue ONLY after the user said yes to the quote (what it does and the credits). Without it nothing runs and nothing is charged.
speakerNoWhether the person or character this workspace speaks as appears in the image (their reference images are attached): `include` when they are in the scene even if the prompt does not read like a photo, `exclude` when they are not (a product, a place, a quote card), `auto` (default) to infer it. No effect for a brand.
charactersNoOptional. Other people or characters of this workspace who appear in the image, by name or id (list_characters): their reference photos are attached so each one looks like themselves. Any of them named in the prompt is added on its own. Up to 3 besides the person or character the workspace speaks as.
workspaceIdNoWorkspace to work on (an id from list_workspaces). Not needed when this connection is tied to one workspace, or when you pass an account: the account's workspace is used.
baseImageUrlNoPublic https URL of an image to edit/vary instead of creating one from scratch.
reservationIdNoOptional. A credit reservation (from an approved production) to pay this image from, instead of the monthly pool.
idempotencyKeyNoOptional. A unique id for this action (16-128 chars: letters, digits, _ : . -). If you are unsure whether a call went through (timeout, network error), repeat it with the SAME idempotencyKey and the same arguments: you get the original result and nothing is done twice.
productImageUrlsNoOptional. Up to 3 public https URLs of photos of a real product that must appear exactly as it is (same packaging, label, logo, colours): a review, a UGC-style shot, someone holding or using it. They are attached as references, so the image costs the same as one with references. Upload local files first with upload_media.

Output Schema

NameRequiredDescriptionDefault
urlNoDurable public URL of the generated image.
promptTipNo
quotaUsedNo
quotaLimitNo
confirmTokenNo
promptWarningsNoWhat the server checked and found missing (warnings: it still generated). needs_customer_fact = ask the person before the next one.
estimatedCreditsNo
needsConfirmationNotrue = this is only the quote: nothing was done or charged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / prompt / description
      Previous value: -"What to draw, in detail: subject, style, composition, colours, aspect. Vague prompts give generic images."New value: +"What to draw, in detail: subject, style, composition, colours, aspect. Vague prompts give generic images. Optional with `shot`."
    • addedInput schema / properties / shot
      Added value: +{
      +  "description": "Optional structured shot: the server composes the prompt from it (after `prompt`, if any) and checks the minimum fields of its type (get_shot_guide).",
      +  "properties": {
      +    "action": {
      +      "description": "Beats with seconds: [\"0-2 s: …\", \"2-5 s: …\"].",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "avoid": {
      +      "description": "What must not appear.",
      +      "type": "string"
      +    },
      +    "camera": {
      +      "description": "Shot type + movement + speed.",
      +      "type": "string"
      +    },
      +    "keep": {
      +      "description": "What must not change.",
      +      "type": "string"
      +    },
      +    "lens": {
      +      "description": "Images: lens and depth of field.",
      +      "type": "string"
      +    },
      +    "light": {
      +      "description": "Direction, hard/soft, colour temperature.",
      +      "type": "string"
      +    },
      +    "look": {
      +      "description": "Photo or illustration, colour treatment.",
      +      "type": "string"
      +    },
      +    "physics": {
      +      "description": "What moves on its own: hair, fabric, water, smoke.",
      +      "type": "string"
      +    },
      +    "sound": {
      +      "description": "Dialogue, music, ambience.",
      +      "type": "string"
      +    },
      +    "subjects": {
      +      "description": "Who or what appears; real = it exists (the customer, their product, their place).",
      +      "items": {
      +        "properties": {
      +          "kind": {
      +            "enum": [
      +              "person",
      +              "product",
      +              "place"
      +            ],
      +            "type": "string"
      +          },
      +          "name": {
      +            "type": "string"
      +          },
      +          "real": {
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "kind",
      +          "name",
      +          "real"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "where": {
      +      "description": "Place, time of day, weather.",
      +      "type": "string"
      +    },
      +    "who": {
      +      "description": "Age, looks, clothing, hair; people: real skin, natural hands.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • removedInput schema / required
      Removed value: -[
      -  "prompt"
      -]
    • addedOutput schema / properties / promptTip
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / promptWarnings
      Added value: +{
      +  "description": "What the server checked and found missing (warnings: it still generated). needs_customer_fact = ask the person before the next one.",
      +  "items": {
      +    "properties": {
      +      "code": {
      +        "type": "string"
      +      },
      +      "message": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "code",
      +      "message"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Changed4 schema fields changed
    • addedOutput schema / properties / confirmToken
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / estimatedCredits
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / needsConfirmation
      Added value: +{
      +  "description": "true = this is only the quote: nothing was done or charged.",
      +  "type": "boolean"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "url"
      -]
  3. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Goes well beyond the annotations: synchronous return, 20 vs 40 credit pricing tied to reference images, billing source (monthly pool vs reservationId vs own key), no charge on failure, and automatic attachment of workspace reference images that raises cost. The confirm workflow and the 'one yes covers the approved plan' rule are real behavioral context. Minor gap: no explicit note on failure modes or latency beyond 'synchronous'.

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?

Front-loaded with purpose and output, then routing, cost, and spend confirmation in a sensible order. It is long and the confirm/no-charge rule is restated several times (also duplicating the confirm param description), which is slight redundancy rather than filler.

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?

For a zero-required-param, 11-parameter, credit-spending generative tool with nested objects, the description covers cost, confirmation flow, default character/person behavior, prompt-authoring guidance, and the URL return. With an output schema present, it correctly does not spend words on return shapes.

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, but the description adds cross-parameter meaning the schema does not: baseImageUrl as a cheaper alternative to edit_image, reference images causing the higher credit tier, and how speaker interacts with workspace type and photo-like prompts. It does not add much beyond the schema for idempotencyKey or reservationId.

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) plus the concrete output (a durable public URL ready for create_post). It draws an explicit boundary with the sibling edit_image, so an agent can pick between the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Routing is spelled out: use edit_image for a plain image+instruction edit, use baseImageUrl here when an aspect ratio, product photo or character is also needed, and use `shot` when the server should compose and validate the prompt. It also gives an explicit when-not via the confirm gate and the speaker include/exclude/auto decision rule.

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