issue_preview_token
Issue a single-use preview-confirmation token after a user views a print via stage, URL, or PNG. Pass it to start_print or fulfillment_order to prevent sending unseen files to a physical printer.
Instructions
Issue a preview-confirmation token for a file about to be printed.
Call this AFTER the user has seen the print, and say WHICH door showed
it — ``door`` is required and is checked against what this server
itself recorded, never taken on your word:
1. ``door="stage"`` — the inline 3D stage (the MCP Apps panel that
opens on a make, which the user can orbit). This is the first and
best option. Accepted only when the panel actually fetched the
geometry for this file (or for the design mesh it was sliced from).
2. ``door="url"`` — a hosted viewer link. Use it when this host draws
no panel. Accepted only when ``show_on_stage(file_path)`` issued
a ``viewer_url`` for this file that is still live (its result
carries one on a host that draws no panel, while the machine is
signed in).
3. ``door="png"`` — the stage's own still (``visualize_model`` with
``renderer`` ``stage`` or ``stage_paint``). The total fallback.
Accepted only when such a render is on record AND the stage is
unavailable for a reason the server can name AND the link door
refused for a reason it recorded. A raw ``openscad`` render is
inspection-only and is refused; a PNG claim on a host that draws
the stage is refused and told to open the stage.
The user approves → you call this tool → you pass the returned token as
``preview_token`` to ``start_print`` (or any other tool that starts a
print) or ``fulfillment_order``. Without a valid token those tools
refuse (unless ``KILN_SKIP_PREVIEW_GATE=1``). This is the deepest
safety gate that prevents an agent from sending a print to the
physical printer without the user ever seeing what's about to be
printed.
Tokens are single-use and expire after ``ttl_seconds`` (default 600
seconds / 10 minutes). Scoped to the specific file hash and
optionally to a specific printer_id so a token for one file can't
be reused to approve a different file.
Args:
file_path: Path to the file to be printed (STL, 3MF, or .gcode).
Hashed to bind the token to specific bytes. If the file
changes between issuing and using the token, the token is
rejected.
door: Required: ``"stage"``, ``"url"`` or ``"png"`` — which door the
user saw the print through; checked against the server's own
record, and refused when it does not match or is left empty.
printer_id: Optional printer model ID to scope the token to a
specific printer. When set, using the token with a different
printer will be rejected.
ttl_seconds: Lifetime of the token (default 600).
Returns:
Dict with ``token``, ``door``, ``evidence`` and ``expires_at``
(unix timestamp); or a refusal whose message says which door to
open and to call this tool again.
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": {
"file_path": "<file_path>"
},
"name": "issue_preview_token"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| door | No | Required: ``"stage"``, ``"url"`` or ``"png"`` — which door the user saw the print through; checked against the server's own record, and refused when it does not match or is left empty. Default: "". | |
| file_path | Yes | Path to the file to be printed (STL, 3MF, or .gcode). Hashed to bind the token to specific bytes. If the file changes between issuing and using the token, the token is rejected. | |
| printer_id | No | Optional printer model ID to scope the token to a specific printer. When set, using the token with a different printer will be rejected. | |
| ttl_seconds | No | Lifetime of the token (default 600). Default: 600. |