Skip to main content
Glama

issue_preview_token

Issue a single-use token after user approves a file preview to authorize printing and prevent unauthorized prints.

Instructions

Issue a preview-confirmation token for a file about to be printed.

Call this AFTER rendering a preview (``visualize_model`` /
``preview_generated_model``) and showing it to the user.  The user
approves → you call this tool → you pass the returned token as
``preview_token`` to ``start_print`` or ``fulfillment_order``.

Without a valid token, ``start_print`` refuses to execute (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.
    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`` and ``expires_at`` (unix timestamp).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
printer_idNo
ttl_secondsNo
Behavior4/5

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

With no annotations, the description carries the full burden. It explains token is single-use, expires, scoped to file hash and optional printer_id, and that changing file invalidates token. Emphasizes this is a safety gate. Does not mention permissions or side effects, but covers critical behavioral aspects well.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured: starts with a concise purpose sentence, then workflow, then behavioral details, then parameter descriptions. No wasted words. Front-loaded with essential information.

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?

Given 3 parameters, no output schema, and no annotations, the description covers return values (Dict with token and expires_at), workflow, binding, expiration, safety gate. Complete for the tool's purpose.

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 has 0% description coverage, but the description fully documents all three parameters: file_path (path, types, hashing), printer_id (optional, scoping behavior), and ttl_seconds (default 600). Adds meaning beyond the schema's type and required field.

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?

Clearly states the tool issues a preview-confirmation token for a file to be printed, specifying the verb 'issue' and the resource 'preview-confirmation token'. It distinguishes from sibling tools like issue_shipping_confirmation_token by context and the explicit workflow described.

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?

Provides explicit workflow: call after rendering preview, user approves, call this tool, then pass token to start_print or fulfillment_order. States that start_print refuses without valid token and mentions the env var skip. Lacks direct comparison to similar sibling tokens but still offers strong guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/codeofaxel/kiln'

If you have feedback or need assistance with the MCP directory API, please join our Discord server