Skip to main content
Glama

Generate

generate
Idempotent

Start an image, video, or audio generation, paid in Gems from the account. config is a partial config in the model's field names (see get_model), layered onto the model's defaults; set model_id to the variant you chose from list_models; mention saved characters and references in prompt as @handle; and pass media inputs as https URLs of the files or data URLs, uploading a larger local file with create_upload first. Check the price with estimate_cost first; it also refuses a config the model would refuse, at no cost. The account runs a limited number of generations at once, counting ones started in the Mage app (get_account shows how many are in flight); past it, generate answers too_many_requests, so start a batch in waves. Make a new idempotency_key for each generation you mean to start, and send the same key again only to retry a call whose response you did not get: the retry returns the original request without charging again. Returns a request_id; call get_request with it to wait for the result.

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": {
      "architecture": "<architecture>",
      "idempotency_key": "<idempotency_key>",
      "config": "<config>"
    },
    "name": "generate"
  }
}

Input Schema

NameRequiredDescriptionDefault
configYesA partial config in the model's field names (see get_model's `input_schema`), layered onto the model's defaults: usually `prompt` and the `model_id` of the variant you chose from list_models (left out, the model's `default_model_id` runs), plus fields such as `aspect_ratio`, `resolution`, `duration`, and media inputs as https or data URLs. Mention saved characters and references in `prompt` as `@handle`.
approval_idNoThe `approval_id` of an `approval_required` answer, once the user has approved it in Mage; send it with the same arguments as the call it came from. It pays for one generation.
architectureYesThe model id from list_models, for example `mango`.
idempotency_keyYesA new unique value (a UUID) for each generation you mean to start; the same value only when retrying one whose response you did not get.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / approval_id
      Added value: +{
      +  "description": "The `approval_id` of an `approval_required` answer, once the user has approved it in Mage; send it with the same arguments as the call it came from. It pays for one generation.",
      +  "format": "uuid",
      +  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true, idempotentHint=true, destructiveHint=false, so the safety profile is covered. The description adds substantial non-annotation context: cost is charged in Gems, estimate_cost pre-validates a config 'at no cost', the account has a concurrent-generation cap shared with the Mage app returning `too_many_requests`, and idempotency-key retry returns the original request without double-charging. That is useful, but it omits the `approval_required` / approval_id flow that the schema documents, leaving the paid-mutation path partially undisclosed in the description.

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 the purpose in the first clause, then ordered by workflow (pick model → price → upload → idempotency → poll). Dense but nearly every sentence carries actionable constraint; the long run-on middle sentence about config and media inputs is the only readability cost.

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 paid, non-idempotent-looking mutation with nested config and no output schema, the description covers cost, concurrency limits, the specific error to expect, retry safety, and a concrete next step (get_request with request_id). Nothing an agent needs to invoke it safely is missing.

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 coverage is 100%, so every parameter including `approval_id` and `architecture` is already documented, making 3 the baseline. The description does add real semantics for `config` (partial config layered onto model defaults, `@handle` mentions, https/data URLs) and for `idempotency_key` (new value per generation, reuse only on retry). However, it never mentions the required top-level `architecture` field, and its talk of 'set `model_id`' risks conflating the top-level model id with the in-config variant.

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?

Opens with a specific verb plus three concrete resources (image, video, audio generation) and the payment mechanism (Gems). Siblings in the list are all read/utility tools (estimate_cost, get_request, list_models), so this is unambiguously the one tool that actually starts a generation.

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?

Explicitly routes the agent to siblings with conditions: 'Check the price with estimate_cost first', 'set model_id to the variant you chose from list_models', 'upload a larger local file with create_upload first', 'call get_request with it to wait for the result'. It also names a when-not/pacing rule: start a batch in waves because of the concurrent-generation limit.

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