Skip to main content
Glama

Generate images, videos and audio as new nodes

playground_media_generate
Idempotent

Batch-generate 1–20 images, videos or audio tracks in one request. Each image/video item becomes a new node, with its prompt Text node and wired referenceNodeIds; each audio item becomes an audio node holding its words (prompt), modelId (default minimax:speech-2.8-hd), voice or style. Write each image/video prompt yourself from the references, following the model's prompt guide (quotes return promptGuides); never paste the user's request into it. Nodes are placed in free space in one revision-checked canvas edit, then run like playground_node_run. quote: true validates references, saves a ten-minute quoteId, prices every item and changes no canvas nodes; execution requires that quoteId (canvas:read). Otherwise it needs media:spend; every paid request returns approval_required for the user to confirm in their agent chat. A retried idempotencyKey never creates or charges twice.

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": {
      "projectId": "<projectId>",
      "items": "<items>",
      "expectedRevision": "<expectedRevision>",
      "idempotencyKey": "<idempotencyKey>"
    },
    "name": "playground_media_generate"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYes
quoteNoWhen true, return pricing without executing paid generation; show the quote and obtain user approval before spending.
quoteIdNoExact quote ID returned by preparation or quoting; submit it with the unchanged quoted request. Required for execution: the unexpired quoteId returned by quote: true.
projectIdYesID of the Playground project chosen for this task; obtain it from project creation, an explicit project link or current context.
idempotencyKeyYesUnique key for this request; reuse only when retrying the identical request after a lost response. Use a new key after quoting or changing inputs.
expectedRevisionYesCurrent canvas revision from canvas_read; on revision_conflict, read again and rebuild the change.

Output Schema

NameRequiredDescriptionDefault
nextNoSuggested next action; it does not authorize spending.
errorNo
itemsNo
nodesNo
runIdNo
reasonNo
reviewNo
statusYes
balanceNo
creditsNo
nodeIdsNo
quoteIdNo
replayedNo
revisionNo
canvasUrlNo
expiresAtNoSerialized ISO timestamp.
projectIdNo
dispatchIdsNo
confirmationNo
totalCreditsNo
failedNodeIdsNo
validitySecondsNo
approvalLocationNo
completedNodeIdsNo
inputFingerprintNo
uncertainNodeIdsNo
sufficientCreditsNo
estimatedBalanceAfterNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare the read/write, open-world, idempotent and destructive profile; the description goes far beyond that with concrete behavior: one revision-checked canvas edit with free-space placement, revision_conflict recovery, a ten-minute quoteId that prices every item and mutates nothing, the canvas:read vs media:spend scope split, and the approval_required confirmation loop. It also states the idempotency guarantee in plain terms ("A retried idempotencyKey never creates or charges twice"), which matches idempotentHint=true rather than contradicting it.

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 batch verb and scope, then the per-item structure, then the quote/spend rules — a sensible order with essentially no filler. Some sentences are long semicolon chains (the quote:true clause in particular) that could be split for faster scanning, but nothing is redundant with the schema or annotations.

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 complex, expensive, mutating batch tool this covers the essentials an agent needs to call it correctly: prompt-authoring rules, quote-before-spend, revision handling, approval flow and idempotency. The remaining gap is what happens after execution — whether generation is async and should be followed via the job/polling tools — which the output schema partially covers but the description leaves unstated.

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?

With 83% schema coverage the baseline is 3, and the description earns more by adding meaning the schema doesn't: the per-item field mapping by kind, the audio default model minimax:speech-2.8-hd, the quote→quoteId contract including the ten-minute lifetime and the requirement that the quoted request be unchanged, and the intent of expectedRevision. It doesn't clarify the interaction between referenceNodeIds max 3 and batch size, which is the one parameter nuance left implicit.

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?

"Batch-generate 1–20 images, videos or audio tracks in one request" gives an exact verb, resource and cardinality, and immediately spells out the per-item output shape (new node + prompt Text node + wired referenceNodeIds, or an audio node holding words/modelId/voice/style). It also distinguishes itself from the generation path of playground_node_run by saying nodes are created "then run like playground_node_run", so an agent knows this tool is the creation step rather than the run step.

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?

It gives actionable when-to-use rules: write the prompt yourself from the references and never paste the user's request, use quote:true first when pricing is needed, and expect approval_required on every paid request. It stops short of explicitly naming alternatives for the cases it doesn't cover (uploading existing media, composing, retry after quote expiry), so the agent must infer those from sibling names.

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.