Skip to main content
Glama

validate_and_prepare_mesh

Validate, repair, analyze, and prepare 3D mesh files for printing by chaining printability and build-volume checks into one quality gate with actionable verdicts.

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, the printability verdict, 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: the layer Kiln
                slices the nozzle at, 0.2 mm on a 0.4 mm nozzle).
            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).

        The verdict decides whether the part passes: 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.  Tell the person the verdict.

        ``result.closure`` says whether the surface of the file handed on
        is closed and every edge of each piece shared by exactly two of
        its triangles, in the same words ``diagnose_mesh`` uses; a part
        that meets itself along a line is never called manifold.
        

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: the layer Kiln slices the nozzle at, 0.2 mm on a 0.4 mm nozzle).
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``.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.6.0
    • addedInput schema / properties / layer_height / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / layer_height / description
      Previous value: -"Print layer height in mm (default 0.2). Default: 0.2."New value: +"Print layer height in mm (default: the layer Kiln slices the nozzle at, 0.2 mm on a 0.4 mm nozzle)."
    • removedInput schema / properties / layer_height / type
      Removed value: -"number"
    • removedInput schema / properties / min_printability_score
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "integer"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "description": "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.",
      -  "title": "Min Printability Score"
      -}
  2. 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: \"\"."
  3. 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: \"\"."
  4. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Goes well beyond the annotations by disclosing that the mesh file may be modified in place when auto_repair or auto_scale is enabled, that the returned path may differ from the input, and that STEP conversion can fail with NO_BACKEND plus a remedy. This is consistent with readOnlyHint=false and destructiveHint=false. The only gap is that the interactive save/overwrite semantics (e.g., whether the original is preserved) are implied rather than spelled out.

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

Conciseness3/5

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

Front-loaded purpose and sibling routing are good, but the Args section duplicates the 100%-covered schema field-by-field, which is dead weight. The genuinely additive material (verdict semantics, closure meaning, in-place modification) is buried after the duplication.

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?

With no output schema, the description carries the return-value burden and does so for the key fields: the final file path, the pass/fail verdict and how it is decided, and the meaning of result.closure. Given ten parameters and a multi-stage pipeline, this is close to sufficient; a brief note on the shape of the recommendations or repair report would close the remaining gap.

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 description coverage is 100%, so the baseline is 3. The Args block is largely a verbatim restatement of the schema text, including the build_volume X/Y/Z all-or-nothing rule and the printer_id fallback, so it adds little new meaning. Marginal value comes from framing nozzle_diameter as 'leave unset to check for the nozzle Kiln has for printer_id'.

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 chain and resource: 'Full validation pipeline: validate, repair, analyze, and prepare a mesh for printing', and names the specific constituent stages (validation → auto-repair → printability → build volume check). It also explicitly separates itself from two siblings by name, so an agent can place it in the catalog without opening any 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 — repair, the printability verdict, build volume checks, and actionable recommendations', and redirects to validate_and_prepare when a more comprehensive 10-step pipeline is wanted. Both the when-to-use and the when-to-prefer-an-alternative 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