Skip to main content
Glama

Generate Media

generate_media

Generate one first-class Library media item from a prompt. Choose generator: text-to-video | text-to-image | image-to-video | text-to-music | text-to-speech | text-to-sfx | auto. Put supported presentation controls in body.style and first/last/image references in body.refs. Returns { id, status:"generating", estimateUsd? }; returns 402 if the estimate exceeds the per-call ceiling. Async — call wait_job(kind="media", id=mediaItemId) or use a webhook (media.completed — status rides the payload). Use the returned id like any other media item.

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": {
      "body": "<body>"
    },
    "name": "generate_media"
  }
}

Input Schema

NameRequiredDescriptionDefault
bodyYesPOST /media/generate body.
commandIdNoRetry identity. A call repeated with the same commandId returns the first result instead of acting twice.

Output Schema

NameRequiredDescriptionDefault
idNo
statusNo
estimateUsdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed22 schema fields changed
    • addedInput schema / $defs
      Added value: +{
      +  "__schema0": {
      +    "enum": [
      +      "text-to-video",
      +      "text-to-image",
      +      "image-to-video",
      +      "text-to-music",
      +      "text-to-speech",
      +      "text-to-sfx",
      +      "auto"
      +    ],
      +    "type": "string"
      +  },
      +  "__schema1": {
      +    "maxLength": 10000,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "__schema2": {
      +    "$ref": "#/$defs/__schema3",
      +    "description": "Free-form generation parameters, read per generator. All generators honor `aspect` (string) + `durationSec` (number) where applicable. text-to-speech honors `voice` (string; default voice when omitted), `speed` (number 0.7-1.2), `stability` (number 0-1), and `styleExaggeration` (number 0-1 → the endpoint's style exaggeration). Provider and model selection are server-owned and cannot be overridden.",
      +    "propertyNames": {
      +      "type": "string"
      +    }
      +  },
      +  "__schema3": {
      +    "additionalProperties": {},
      +    "properties": {},
      +    "type": "object"
      +  },
      +  "__schema4": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "firstFrameMediaId": {
      +        "type": "string"
      +      },
      +      "imageMediaIds": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "lastFrameMediaId": {
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "__schema5": {
      +    "maxLength": 128,
      +    "minLength": 1,
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / body / properties / generator / $ref
      Added value: +"#/$defs/__schema0"
    • removedInput schema / properties / body / properties / generator / enum
      Removed value: -[
      -  "text-to-video",
      -  "text-to-image",
      -  "image-to-video",
      -  "text-to-music",
      -  "text-to-speech",
      -  "text-to-sfx",
      -  "auto"
      -]
    • removedInput schema / properties / body / properties / generator / type
      Removed value: -"string"
    • addedInput schema / properties / body / properties / prompt / $ref
      Added value: +"#/$defs/__schema1"
    • removedInput schema / properties / body / properties / prompt / maxLength
      Removed value: -10000
    • removedInput schema / properties / body / properties / prompt / minLength
      Removed value: -1
    • removedInput schema / properties / body / properties / prompt / type
      Removed value: -"string"
    • addedInput schema / properties / body / properties / refs / $ref
      Added value: +"#/$defs/__schema4"
    • removedInput schema / properties / body / properties / refs / additionalProperties
      Removed value: -false
    • removedInput schema / properties / body / properties / refs / properties
      Removed value: -{
      -  "firstFrameMediaId": {
      -    "type": "string"
      -  },
      -  "imageMediaIds": {
      -    "items": {
      -      "type": "string"
      -    },
      -    "type": "array"
      -  },
      -  "lastFrameMediaId": {
      -    "type": "string"
      -  }
      -}
    • removedInput schema / properties / body / properties / refs / type
      Removed value: -"object"
    • addedInput schema / properties / body / properties / style / $ref
      Added value: +"#/$defs/__schema2"
    • removedInput schema / properties / body / properties / style / additionalProperties
      Removed value: -{}
    • removedInput schema / properties / body / properties / style / description
      Removed value: -"Free-form generation parameters, read per generator. All generators honor `aspect` (string) + `durationSec` (number) where applicable. text-to-speech honors `voice` (string; default voice when omitted), `speed` (number 0.7-1.2), `stability` (number 0-1), and `styleExaggeration` (number 0-1 → the endpoint's style exaggeration). Provider and model selection are server-owned and cannot be overridden."
    • removedInput schema / properties / body / properties / style / properties
      Removed value: -{}
    • removedInput schema / properties / body / properties / style / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / body / properties / style / type
      Removed value: -"object"
    • addedInput schema / properties / commandId / $ref
      Added value: +"#/$defs/__schema5"
    • removedInput schema / properties / commandId / maxLength
      Removed value: -128
    • removedInput schema / properties / commandId / minLength
      Removed value: -1
    • removedInput schema / properties / commandId / type
      Removed value: -"string"
  2. Changed1 schema field changed
    • addedInput schema / properties / commandId
      Added value: +{
      +  "description": "Retry identity. A call repeated with the same commandId returns the first result instead of acting twice.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • addedInput schema / properties / body / properties / style / properties
      Added value: +{}
  4. First observed

TDQS

A4.7/5.0
Behavior5/5

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

With annotations silent on cost and async semantics, the description carries that load well: it discloses the return shape ({ id, status:"generating", estimateUsd? }), the 402 behavior when the estimate exceeds the per-call ceiling, and that the operation is async with two completion paths. It also tells the agent the returned id is a normal media item id, which prevents follow-on misuse.

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?

Five short sentences, front-loaded with the verb and generator list, then effects, then async guidance. No filler; even the return-shape parenthetical is compressed to a single fragment.

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 nested-schema, async, paid generation tool, the description covers selection, input placement, error condition, return shape, and both completion mechanisms. An output schema exists, so restating the payload is optional and the description already does the essential part.

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 already 100%, so the baseline is 3, but the description adds real routing value for the nested objects: style holds presentation controls and refs holds first/last/image references. It omits any mention of commandId, the retry-identity parameter, which is a meaningful gap for a non-idempotent generation call.

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 one first-class Library media item from a prompt') and immediately enumerates the seven mutually exclusive generator modes, so the agent knows exactly what the tool produces. It is clearly distinguishable from siblings like import_media, prepare_media, and compose.

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 concrete routing: pick a generator, place presentation controls in body.style and references in body.refs, then handle the async result via wait_job(kind="media", id=mediaItemId) or a media.completed webhook. It does not explicitly say when NOT to use this versus alternatives such as import_media or preview_clip, which keeps it from a 5.

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.