Skip to main content
Glama

Generate the cast's portraits (paid)

generate_cast_portraits
Destructive

BUYS the portraits for a cast draft: one image generation per member that still needs a face, at the chosen image model's rate, then saves every member to the user's character library. The cast's paid step (the webapp's 'Generate cast' button). WHEN: the user has READ the draft from generate_cast, accepted it, and said go to the price. Take the figures from the draft's own portrait_models (per_portrait_tokens, total_tokens), never from memory (a cast portrait prices differently from an ordinary image): 'portraits: 3 on = <total_tokens> T, or at <per_portrait_tokens> each. Go?'. estimate_only: true re-prices against the CURRENT catalog if the draft has sat a while. OFFER THE IMAGE MODEL ONCE, in a line you are already writing (not an interview): name the model that draws the pictures in plain words with its default and price; no preference means the series' default. THE CARD: this call already put the aicut cast card up, each portrait filling in as it generates: do not poll or call show_generation (one get_image read of portrait_image_id if asked). No card (a terminal)? Poll each generating member's portrait_image_id with wait_for_generation (media image) and give the urls. AFTER: portraits generate asynchronously, only for members that needed one. portrait_status: "ready" with a null portrait_image_id was NOT generated and NOT charged (it arrived photographed, or already had a face): not missing. A member whose id is null could not be saved and cannot be a cast_member_id. charged_tokens is what moved. One face or one character wrong: story-episode recipe, step 5. THE DRAFT IS SPENT once this succeeds: a repeat with the same draft_id answers 404 cast_draft_not_found or a 201 with charged_tokens: 0 (nothing bought): report it as 'already done', never as a second purchase. IF IT REFUSES PART WAY (402 or a cap): the portraits already generated WERE charged (partial_cast: true, portraits_minted, charged_tokens): tell the user that number, never 'nothing was charged'. Retrying the SAME draft_id generates and charges only the missing members. A 400 naming draft_id means what you passed is not a cast draft id (a job id, a member id): re-read generate_cast's response; there is no other route to a draft. SPENDS TOKENS: price with estimate_only: true, state the price in the same message as your ask, wait for a go naming THIS purchase (SPENDING RULES: get_recipe spending-rules).

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": {
      "draft_id": "<draft_id>"
    },
    "name": "generate_cast_portraits"
  }
}

Input Schema

NameRequiredDescriptionDefault
draft_idYesThe `draft_id` from `generate_cast`.
estimate_onlyNoPrice only; creates nothing.
portrait_modelNoOne of the draft's `portrait_models` ids. It draws the faces: name it with the price (see OFFER THE IMAGE MODEL), then omit it if the user has no preference (`default: true` is what the series is tuned for).

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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, which already declare destructive, non-idempotent, open-world. It discloses async generation, that ready-with-null-id members were not generated or charged, partial-charge behavior on 402/cap (`partial_cast`, `portraits_minted`), retry semantics on the same `draft_id`, and the 404/`charged_tokens: 0` spent-draft signature. It does not contradict `idempotentHint: false` — the retry only charges missing members. Minor gap: no statement of per-request rate limits or concurrency behavior when many members are generating.

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 spend action and well-structured by caps headers (WHEN, THE CARD, AFTER, THE DRAFT IS SPENT, IF IT REFUSES, SPENDS TOKENS), which makes it scannable despite its length. It is long and repeats the price-then-ask instruction in both the WHEN block and the closing SPENDS TOKENS line, which is defensible for a purchase tool but not maximal concision.

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?

With no output schema, the description carries the return-shape burden and does it: `portrait_status`, `portrait_image_id`, `charged_tokens`, `portraits_minted`, `partial_cast`, and the null-`id` caveat that such a member cannot be a `cast_member_id`. For a costly, non-idempotent, async tool this is complete enough to call and to recover from failure.

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 still earns higher by explaining the purchase-relevant semantics: prices must come from the draft's `portrait_models` `per_portrait_tokens`/`total_tokens` "never from memory", `estimate_only` re-prices "against the CURRENT catalog", and omitting `portrait_model` means the series default. That is meaning beyond a one-line schema hint.

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 with cost framing: "BUYS the portraits for a cast draft: one image generation per member that still needs a face... then saves every member to the user's character library." It is clearly distinguishable from the sibling `generate_cast` (which produces the draft) and `regenerate_cast_portrait` (single-face repair).

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?

Explicit precondition ("the user has READ the draft from `generate_cast`, accepted it, and said go to the price"), explicit repricing path via `estimate_only: true`, and explicit negative routing: "do not poll or call `show_generation`", use `wait_for_generation` on a terminal. It also names the recipe to consult for fixes rather than reusing this tool.

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.