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.

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.8/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing cost (20 credits, 40 with references), the credit pool, that nothing is charged on failure or on the confirm-less first call, and that the call is synchronous. It also explains why some calls cost more (workspace reference images attached) and the default speaker inference rule.

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 the URL return, then cost, then the confirm protocol; every paragraph covers a distinct concern. The confirm paragraph is long and repeats 'nothing runs and nothing is charged' already implied by the confirm parameter description, which is the main argument against a 5.

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 an 11-param generative tool with nested shot objects and a heavy credit side-effect, the description covers cost model, sync behavior, the confirm gate, reference/character attachment behavior, and where to get prompt and quota guidance. An output schema exists, so return-value detail is correctly omitted.

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 earns a bump by adding behavior the schema does not: speaker defaults ('a character appears in every image and a person only in photo-like images'), baseImageUrl as an edit path, and shot server-side prompt composition and validation. Prompt-writing guidance points to get_shot_guide, which is useful framing but not new parameter syntax.

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 return value and downstream use ('durable public URL ready to pass to create_post as media'). It also draws the boundary to the sibling edit_image explicitly, so an agent can pick between them 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?

Names the alternative path ('To change an image you already have, edit_image is the direct route') and the condition where baseImageUrl is used instead. It adds prerequisites (get_shot_guide, get_image_quota, list_characters) and an explicit before/after confirm workflow that tells the agent exactly how to sequence calls.

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