Skip to main content
Glama

draw

Composite a cut-out product photo into a generated studio, concrete, or warm scene without regenerating the product, returning a composite asset and fidelity receipt.

Instructions

Stage the real product into a generated scene. Fidelity Lock applies.

Args: asset: Asset handle (asset://) of the cut-out product layer produced by cut_out (kind foreground_png, chained to a source photo). Anything else is refused before any billing. scene_prompt: Scene preferences compiled into a versioned StageSpec. Only studio, concrete and warm selections are recognized; unmatched prose is dropped. The result discloses the compiled stage_spec and this limitation. Arbitrary rooms and source-camera matching are not supported by the fixed template. The scene text describes the environment only and must never name the product: before any spend it is screened against the cut concept (the scene guard, recorded on the receipt as scene_guard), and a prompt naming the product is refused with SCENE_NAMES_PRODUCT, because naming it makes the image model paint its own copy of the product into the scene.

The background plate is generated by muse-image-1.0 (billed through the spend-cap choke point at the per-image rate) and stored as a background_plate asset; deterministic code then fits the PLATE to the product's dimensions and composites the stored product layer onto it. The product layer is never regenerated, restyled, scaled, or "improved" by a model, and it is never sent to the image model. Returns the composite's asset handle, its fidelity receipt (source / foreground / mask / plate hashes, transformations, the measured changed-opaque-pixel count), and an image preview. The receipt is also persisted beside the composite in the asset store as <asset_id>.receipt.json, enriched with the billed cost and call attribution, so it survives a client dropping the return value and verify_receipt_from_disk can pick it up from the store alone. If the compositor ever measured changed opaque pixels, the tool returns a FIDELITY_VIOLATION error instead of presenting the composite under a false receipt.

Failures return a structured error: NOT_CONFIGURED (no META_API_KEY; checked before billing, so no ledger write), IMAGE_REFUSED / BAD_IMAGE_RESPONSE / IMAGE_CALL_FAILED (the plate call failed; its reservation stays counted as spend). A failed draw never falls back to regenerating the product, and in live mode it never silently substitutes the placeholder plate. Measurable plate rejection retries once; a horizon-placement mismatch goes straight to a disclosed studio-gray fallback without buying an identical second attempt.

Offline dev mode: with AGENTHAND_DRAW_PLACEHOLDER_PLATE=1 the plate is the deterministic local placeholder and no API call is made. That flag exists for tests and no-key demos only.

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": {
      "asset": "<asset>",
      "scene_prompt": "<scene_prompt>"
    },
    "name": "draw"
  }
}

Input Schema

NameRequiredDescriptionDefault
assetYes
scene_promptYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so richly: billing through the spend-cap choke point, the Fidelity Lock guarantee that the product layer is never regenerated or sent to the image model, retry behavior, offline placeholder mode, and the exact error codes (NOT_CONFIGURED, SCENE_NAMES_PRODUCT, FIDELITY_VIOLATION). This is behavior beyond what any structured field discloses.

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?

The purpose and Args are front-loaded and each section is purposeful, but the body is dense and long, with some detail (receipt persistence, retry nuance) that could be tightened. Length is largely justified by the billing and fidelity complexity, so it is efficient rather than bloated.

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 tool with real billing, fidelity guarantees, and multiple failure modes, the description covers returns, error codes, receipt persistence, and offline dev mode. An output schema exists so return explanation is optional, yet the description still discloses the composite handle, receipt, and preview, leaving no significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate and it does: asset is specified as an asset://<id> handle from cut_out with kind foreground_png, and scene_prompt is explained as text compiled into a versioned StageSpec recognizing only studio/concrete/warm, with unmatched prose dropped and a prohibition on naming the product. This meaning is entirely absent from the bare schema.

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?

The opening sentence states a specific verb and resource ('Stage the real product into a generated scene') and the Args section ties the asset to cut_out's foreground_png output, distinguishing it from siblings like cut_out and identify. An agent can tell what this tool does without opening the schema.

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?

The description gives clear preconditions (asset must be asset://<id> from cut_out, kind foreground_png, else refused) and explicit exclusions ('Arbitrary rooms and source-camera matching are not supported'). It stops short of naming an alternative tool to use for unsupported scene types, so it is strong context but not full when/when-not routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools