Skip to main content
Glama

prepare_ai_model_for_print

Fix AI-generated 3D models exported in the wrong units, convert them to printable millimeter scale, and validate mesh size, bed fit, and print recommendations.

Instructions

Prepare any AI-generated model for printing — fixes the unit mix-up.

        AI model generators (Meshy, Tripo, Stability, Gemini) routinely
        export models in meters instead of millimeters, so a 60mm figurine
        reads as 0.06mm.  This tool corrects that by the real unit
        conversion when exactly one explains the size — never by scaling
        to an invented "reasonable" target — then runs the full validation
        pipeline and provides smart recommendations for simplification
        and hollowing.

        Pipeline:
            1. Run validate_and_prepare for baseline analysis
            2. Size — scale to target_height_mm when given; otherwise
               apply a unit correction only when exactly one real
               conversion (meters, centimeters, inches, microns) lands
               the model at a printable size.  A size several units
               could explain, or none can, is reported, never guessed at.
            3. Mesh simplification recommendation (if > 100K triangles)
            4. Smart hollow recommendation (only when appropriate)
            5. Re-validate the scaled model
            6. Return combined before/after comparison

        Works with STL, OBJ, and 3MF files.

        :param input_path: Path to the AI-generated model file.
        :param target_height_mm: Desired height in mm — an instruction,
            honored at any starting size.  If 0, only a unit mistake is
            ever fixed; the model's designed size is otherwise kept.
        :param printer_id: Optional printer model ID for bed-fit checking.
        :param material: Material name (default "PLA") for material checks.
        :returns: Dict with original/prepared comparison, actions taken,
            recommendations, and next_action for slicing.

INLINE 3D STAGE: on success this tool opens Kiln's interactive 3D stage — an inline viewer panel the user can orbit, zoom, and turn over — in hosts that render MCP Apps panels (Kiln's hosted connection attaches a browser stage link for hosts that don't). Oversized meshes are decimated automatically for the stage; the PNG preview is the floor, not the whole experience.

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": {
      "input_path": "<input_path>"
    },
    "name": "prepare_ai_model_for_print"
  }
}

Input Schema

NameRequiredDescriptionDefault
materialNoMaterial name (default "PLA") for material checks. Default: "PLA".
input_pathYesPath to the AI-generated model file.
printer_idNoOptional printer model ID for bed-fit checking. Default: "".
target_height_mmNoDesired height in mm — an instruction, honored at any starting size. If 0, only a unit mistake is ever fixed; the model's designed size is otherwise kept. Default: 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.5.1
    • addedInput schema / properties / input_path / description
      Added value: +"Path to the AI-generated model file."
    • changedInput schema / properties / material / description
      Previous value: -"Default: \"PLA\"."New value: +"Material name (default \"PLA\") for material checks. Default: \"PLA\"."
    • changedInput schema / properties / printer_id / description
      Previous value: -"Default: \"\"."New value: +"Optional printer model ID for bed-fit checking. Default: \"\"."
    • changedInput schema / properties / target_height_mm / description
      Previous value: -"Default: 0."New value: +"Desired height in mm — an instruction, honored at any starting size.  If 0, only a unit mistake is ever fixed; the model's designed size is otherwise kept. Default: 0."
  2. Changed6 schema fields changedv1.5.0
    • removedInput schema / properties / material / default
      Removed value: -"PLA"
    • addedInput schema / properties / material / description
      Added value: +"Default: \"PLA\"."
    • removedInput schema / properties / printer_id / default
      Removed value: -""
    • addedInput schema / properties / printer_id / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / target_height_mm / default
      Removed value: -0
    • addedInput schema / properties / target_height_mm / description
      Added value: +"Default: 0."
  3. Changed1 schema field changedv1.3.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "title": "prepare_ai_model_for_printDictOutput",
      -  "type": "object"
      -}New value: +null
  4. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only say it is a non-destructive write with no open-world access; the description adds the pipeline stages, the deliberate refusal to guess when zero or multiple unit conversions fit, the decimation behavior for the 3D stage, and the return payload keys. It never states whether the prepared model is written to a new file or modified in place, which is the one behavioral fact an agent still needs.

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 core purpose and problem statement before the numbered pipeline, so a reader can stop early. There is mild redundancy between the prose about 'never scaling to an invented reasonable target' and step 2 of the pipeline, plus a lengthy appendix about the inline 3D stage.

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?

Covers supported formats (STL, OBJ, 3MF), the six-stage pipeline, ambiguity handling, and the return shape despite having no output schema. The remaining gap is the write semantics — new artifact vs. in-place replacement — which matters for a tool flagged readOnlyHint=false in a workflow that then slices the result.

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

Parameters3/5

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

Schema coverage is 100% and the parameter descriptions already carry the same text about target_height_mm=0, printer_id bed-fit checks, and the PLA default. The description reinforces the semantics of target_height_mm (an instruction vs. a unit correction) but adds no format or interaction detail beyond what the schema states.

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 concrete verb and resource ('Prepare any AI-generated model for printing') and immediately narrows the job to a specific failure mode: unit-mix-up from Meshy/Tripo/Stability/Gemini exports. This distinguishes it from generic scalers like rescale_model or scale_mesh_to_fit, and the enumerated pipeline makes the scope unambiguous.

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?

Gives a clear triggering condition (a 60mm figurine reading as 0.06mm) and a clear rule for the alternative mode: target_height_mm is an instruction honored at any start size, while 0 means only unit mistakes are fixed. It does not name sibling tools like rescale_model or validate_and_prepare as alternatives to prefer, so routing guidance is implicit rather than explicit.

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