Skip to main content
Glama

validate_and_prepare_mesh

Validate, repair, and analyze a 3D mesh, then check printability and build volume so it is ready for slicing or printing.

Instructions

Full validation pipeline: validate, repair, analyze, and prepare a mesh for printing.

        **See also:** ``validate_and_prepare`` for a more comprehensive
        10-step pipeline (format, mesh, scale, repair, printability,
        structural, bed-fit, material, and cost estimation).

        Runs every AI-generated mesh through Kiln's engineering review before
        it reaches the slicer or printer.  Chains validation → auto-repair →
        printability analysis → build volume check into a single quality gate.

        **Use this instead of ``validate_generated_mesh`` when you want the
        full pipeline** — repair, printability scoring, build volume checks,
        and actionable recommendations.

        The mesh file may be modified in place if ``auto_repair`` or
        ``auto_scale`` is enabled.  The response includes the final file
        path (which may differ from the input if repairs created a new file).

        Args:
            file_path: Path to an STL, OBJ, GLB, or STEP/STP file.
                STEP is converted to a mesh on the way in; if no
                converter is installed the call returns ``NO_BACKEND``
                with a ``remedy`` — read it rather than guessing whether
                the user can fix this (``kiln install-step-backend``) or
                is on a hosted server with nothing to install.
            material: Filament material for printability analysis (default PLA).
            nozzle_diameter: Printer nozzle diameter in mm.  Leave unset to
                check for the nozzle Kiln has for ``printer_id``.
            layer_height: Print layer height in mm (default 0.2).
            build_volume_x: Build volume X in mm.  Used only when X, Y and
                Z are all given; otherwise ``printer_id`` supplies the bed.
            build_volume_y: Build volume Y in mm.  Used only when X, Y and
                Z are all given; otherwise ``printer_id`` supplies the bed.
            build_volume_z: Build volume Z in mm.  Used only when X, Y and
                Z are all given; otherwise ``printer_id`` supplies the bed.
            printer_id: Optional supported printer model id.  When
                provided, printer intelligence supplies the build volume.
            auto_repair: Auto-repair non-manifold meshes (default True).
            auto_scale: Auto-scale if mesh exceeds build volume (default False).
            min_printability_score: A lowest score (0-100) you require,
                for every part.  Leave unset and the verdict decides: a
                part that prints, as it is or with supports, passes;
                one that won't print fails; one with no single cause
                named is judged against Kiln's own floor.
        

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": "validate_and_prepare_mesh"
  }
}

Input Schema

NameRequiredDescriptionDefault
materialNoFilament material for printability analysis (default PLA). Default: "PLA".
file_pathYesPath to an STL, OBJ, GLB, or STEP/STP file. STEP is converted to a mesh on the way in; if no converter is installed the call returns ``NO_BACKEND`` with a ``remedy`` — read it rather than guessing whether the user can fix this (``kiln install-step-backend``) or is on a hosted server with nothing to install.
auto_scaleNoAuto-scale if mesh exceeds build volume (default False). Default: false.
printer_idNoOptional supported printer model id. When provided, printer intelligence supplies the build volume. Default: "".
auto_repairNoAuto-repair non-manifold meshes (default True). Default: true.
layer_heightNoPrint layer height in mm (default 0.2). Default: 0.2.
build_volume_xNoBuild volume X in mm. Used only when X, Y and Z are all given; otherwise ``printer_id`` supplies the bed.
build_volume_yNoBuild volume Y in mm. Used only when X, Y and Z are all given; otherwise ``printer_id`` supplies the bed.
build_volume_zNoBuild volume Z in mm. Used only when X, Y and Z are all given; otherwise ``printer_id`` supplies the bed.
nozzle_diameterNoPrinter nozzle diameter in mm. Leave unset to check for the nozzle Kiln has for ``printer_id``.
min_printability_scoreNoA lowest score (0-100) you require, for every part. Leave unset and the verdict decides: a part that prints, as it is or with supports, passes; one that won't print fails; one with no single cause named is judged against Kiln's own floor.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changedv1.5.1
    • changedInput schema / properties / auto_repair / description
      Previous value: -"Default: true."New value: +"Auto-repair non-manifold meshes (default True). Default: true."
    • changedInput schema / properties / auto_scale / description
      Previous value: -"Default: false."New value: +"Auto-scale if mesh exceeds build volume (default False). Default: false."
    • addedInput schema / properties / build_volume_x / description
      Added value: +"Build volume X in mm.  Used only when X, Y and Z are all given; otherwise ``printer_id`` supplies the bed."
    • addedInput schema / properties / build_volume_y / description
      Added value: +"Build volume Y in mm.  Used only when X, Y and Z are all given; otherwise ``printer_id`` supplies the bed."
    • addedInput schema / properties / build_volume_z / description
      Added value: +"Build volume Z in mm.  Used only when X, Y and Z are all given; otherwise ``printer_id`` supplies the bed."
    • addedInput schema / properties / file_path / description
      Added value: +"Path to an STL, OBJ, GLB, or STEP/STP file. STEP is converted to a mesh on the way in; if no converter is installed the call returns ``NO_BACKEND`` with a ``remedy`` — read it rather than guessing whether the user can fix this (``kiln install-step-backend``) or is on a hosted server with nothing to install."
    • changedInput schema / properties / layer_height / description
      Previous value: -"Default: 0.2."New value: +"Print layer height in mm (default 0.2). Default: 0.2."
    • changedInput schema / properties / material / description
      Previous value: -"Default: \"PLA\"."New value: +"Filament material for printability analysis (default PLA). Default: \"PLA\"."
    • addedInput schema / properties / min_printability_score / anyOf
      Added value: +[
      +  {
      +    "type": "integer"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / min_printability_score / description
      Previous value: -"Default: 40."New value: +"A lowest score (0-100) you require, for every part.  Leave unset and the verdict decides: a part that prints, as it is or with supports, passes; one that won't print fails; one with no single cause named is judged against Kiln's own floor."
    • removedInput schema / properties / min_printability_score / type
      Removed value: -"integer"
    • addedInput schema / properties / nozzle_diameter / description
      Added value: +"Printer nozzle diameter in mm.  Leave unset to check for the nozzle Kiln has for ``printer_id``."
    • changedInput schema / properties / printer_id / description
      Previous value: -"Default: \"\"."New value: +"Optional supported printer model id.  When provided, printer intelligence supplies the build volume. Default: \"\"."
  2. Changed18 schema fields changedv1.5.0
    • removedInput schema / properties / auto_repair / default
      Removed value: -true
    • addedInput schema / properties / auto_repair / description
      Added value: +"Default: true."
    • removedInput schema / properties / auto_scale / default
      Removed value: -false
    • addedInput schema / properties / auto_scale / description
      Added value: +"Default: false."
    • removedInput schema / properties / build_volume_x / default
      Removed value: -null
    • removedInput schema / properties / build_volume_y / default
      Removed value: -null
    • removedInput schema / properties / build_volume_z / default
      Removed value: -null
    • removedInput schema / properties / layer_height / default
      Removed value: -0.2
    • addedInput schema / properties / layer_height / description
      Added value: +"Default: 0.2."
    • removedInput schema / properties / material / default
      Removed value: -"PLA"
    • addedInput schema / properties / material / description
      Added value: +"Default: \"PLA\"."
    • removedInput schema / properties / min_printability_score / default
      Removed value: -40
    • addedInput schema / properties / min_printability_score / description
      Added value: +"Default: 40."
    • addedInput schema / properties / nozzle_diameter / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / nozzle_diameter / default
      Removed value: -0.4
    • removedInput schema / properties / nozzle_diameter / type
      Removed value: -"number"
    • removedInput schema / properties / printer_id / default
      Removed value: -""
    • addedInput schema / properties / printer_id / description
      Added value: +"Default: \"\"."
  3. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing that the input mesh file may be modified in place when auto_repair/auto_scale are on and that the returned file path may differ from the input — the single most consequential behavior for a caller. It also documents the NO_BACKEND failure mode for STEP input and tells the agent to read the returned remedy rather than guess at installation.

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?

Well-structured: pipeline summary, sibling routing, mutation warning, then per-argument notes. The per-argument section largely restates schema descriptions word for word, which is waste, and the 'See also' block precedes the primary purpose rather than following it.

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?

For an 11-parameter mutating tool with no output schema, the definition covers defaults, mutation semantics, and one key error path, which is close to sufficient. It stops short of characterizing the validation/repair/printability results the caller receives (apart from mentioning a final file path), leaving the agent to discover the response shape empirically.

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 already 100%, so the baseline is 3; the description earns extra by explaining interaction rules the schema does not (build_volume_x/y/z are only honored when all three are supplied, otherwise printer_id supplies the bed) and by defining what an unset min_printability_score falls back to. Much of the Args block duplicates schema text verbatim, which limits the added value.

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?

Opens with a specific verb chain and resource: 'Full validation pipeline: validate, repair, analyze, and prepare a mesh for printing,' then explicitly distinguishes itself from two named siblings (validate_and_prepare, validate_generated_mesh). An agent can pick this tool over its near-namesakes without opening either schema.

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?

Gives an explicit selection rule — 'Use this instead of validate_generated_mesh when you want the full pipeline' — and routes the agent to validate_and_prepare for the more comprehensive 10-step pipeline. Both the when-to-use and the when-to-use-something-else conditions are stated.

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