Skip to main content
Glama

rebuild_design

Destructive

Re-executes a saved design recipe to regenerate print-ready output: recompiles OpenSCAD source with saved parameters for exact geometry or re-slices recorded meshes after edits.

Instructions

Re-execute the full build pipeline from a saved design recipe.

        Two modes, chosen by what the recipe carries — the result names
        which one ran:

        - **Parametric** (the recipe has OpenSCAD source): the geometry
          is RE-DERIVED.  The recipe's numeric parameters are applied to
          the source and recompiled, so wall thicknesses and fastener
          holes come out exactly as designed.  To resize a parametric
          design, change the parameter — with ``update_scad_parameter``
          on the source, or on the recipe's parameters — and rebuild.
          Never scale the mesh instead: it scales every feature with
          the body, so a 3mm wall becomes 3.6mm and a 3.4mm M3
          clearance hole becomes 4.08mm — no longer the fit it was
          dimensioned for.
        - **Mesh** (no source): the recorded part meshes are re-sliced
          exactly as they are.  A geometry change needs a mesh edit first
          (``rescale_model``, ``thicken_mesh_walls``, ...), then a rebuild.

        Every parameter is itemized as applied, absent from the source,
        or skipped with a reason — an edit this tool cannot honor is
        reported, never silently dropped.

        The artifact is a print-ready 3MF where a Bambu printer is
        registered and the merged G-code otherwise (send that with
        ``upload_file``); ``wrapped`` says which one you got.

        The slicer's own time estimate for the rebuilt slice is kept on
        the version, and ``print_time`` says it ("About 3h 1m, the
        slicer's estimate.") when the slice states one.

        When the render pipeline is available this also returns an
        inline preview of the rebuilt design; display that image to the
        user rather than summarizing it. The rebuild itself never
        depends on it.

        Example: rebuild_design("prints/bracket/")

        :param recipe_path: The design directory, or the recipe file.
        :param goal_id: Optional saved-goal id. When supplied it is
            recorded on the recipe before the rebuild, so the output
            carries the goal in its provenance; when omitted the
            recipe's existing goal is kept, so iterating a
            goal-attached design keeps it automatically.
        :param speed_by_height: The person's own speeds for height ranges of the part, only when they
            ask for them: a list like ``[{"from_mm": 0, "to_mm": 6, "percent": 50}, {"from_mm": 6,
            "speed_mm_s": 120}]`` (millimetres up from the plate; ``to_mm`` left out means to the top;
            one speed per range), or ``"kiln"`` to have Kiln choose them from the part's shape (Kiln
            Pro).  ``slice_model`` says what is read back and what is refused.
        :param mixed_nozzle_experiment: The person has said yes, for this print, to a slice
            refused with ``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an
            experiment). Only on their yes, each time; ``slice_model`` says what follows.
        :param soft_nozzle_confirmed: The owner has said to print anyway
            a slice refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive
            filament through a nozzle on record that is not
            wear-resistant).  Only on their word, never on your own
            judgement.
        :param filament_map: Only for a printer with more than one
            nozzle: the nozzle (1 for the first) each filament prints
            from, one number per filament in filament order.  Leave
            unset to let the slicer choose.
        :returns: Dict with the print artifact, the mode used, and
            per-part or per-parameter results.

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.

MAKE DOORS: design_session, Kiln's front door for making an object, is not installed here (signed in to Kiln it runs on Kiln's servers). On this install compile_scad IS the make → preview → iterate loop: make it, show the preview, iterate.

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": {
      "recipe_path": "<recipe_path>"
    },
    "name": "rebuild_design"
  }
}

Input Schema

NameRequiredDescriptionDefault
goal_idNoOptional saved-goal id. When supplied it is recorded on the recipe before the rebuild, so the output carries the goal in its provenance; when omitted the recipe's existing goal is kept, so iterating a goal-attached design keeps it automatically. Default: "".
recipe_pathYesThe design directory, or the recipe file.
filament_mapNoOnly for a printer with more than one nozzle: the nozzle (1 for the first) each filament prints from, one number per filament in filament order. Leave unset to let the slicer choose.
speed_by_heightNoThe person's own speeds for height ranges of the part, only when they ask for them: a list like ``[{"from_mm": 0, "to_mm": 6, "percent": 50}, {"from_mm": 6, "speed_mm_s": 120}]`` (millimetres up from the plate; ``to_mm`` left out means to the top; one speed per range), or ``"kiln"`` to have Kiln choose them from the part's shape (Kiln Pro). ``slice_model`` says what is read back and what is refused.
soft_nozzle_confirmedNoThe owner has said to print anyway a slice refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive filament through a nozzle on record that is not wear-resistant). Only on their word, never on your own judgement. Default: false.
mixed_nozzle_experimentNoThe person has said yes, for this print, to a slice refused with ``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an experiment). Only on their yes, each time; ``slice_model`` says what follows. Default: false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.6.0
    • removedInput schema / properties / brief_id
      Removed value: -{
      -  "description": "Optional saved-goal id. When supplied it is recorded on the recipe before the rebuild, so the output carries the goal in its provenance; when omitted the recipe's existing goal is kept, so iterating a goal-attached design keeps it automatically. Default: \"\".",
      -  "title": "Brief Id",
      -  "type": "string"
      -}
    • addedInput schema / properties / filament_map
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Only for a printer with more than one nozzle: the nozzle (1 for the first) each filament prints from, one number per filament in filament order.  Leave unset to let the slicer choose.",
      +  "title": "Filament Map"
      +}
    • addedInput schema / properties / goal_id
      Added value: +{
      +  "description": "Optional saved-goal id. When supplied it is recorded on the recipe before the rebuild, so the output carries the goal in its provenance; when omitted the recipe's existing goal is kept, so iterating a goal-attached design keeps it automatically. Default: \"\".",
      +  "title": "Goal Id",
      +  "type": "string"
      +}
    • addedInput schema / properties / mixed_nozzle_experiment
      Added value: +{
      +  "description": "The person has said yes, for this print, to a slice refused with ``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an experiment). Only on their yes, each time; ``slice_model`` says what follows. Default: false.",
      +  "title": "Mixed Nozzle Experiment",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / soft_nozzle_confirmed
      Added value: +{
      +  "description": "The owner has said to print anyway a slice refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive filament through a nozzle on record that is not wear-resistant).  Only on their word, never on your own judgement. Default: false.",
      +  "title": "Soft Nozzle Confirmed",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / speed_by_height
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "The person's own speeds for height ranges of the part, only when they ask for them: a list like ``[{\"from_mm\": 0, \"to_mm\": 6, \"percent\": 50}, {\"from_mm\": 6, \"speed_mm_s\": 120}]`` (millimetres up from the plate; ``to_mm`` left out means to the top; one speed per range), or ``\"kiln\"`` to have Kiln choose them from the part's shape (Kiln Pro).  ``slice_model`` says what is read back and what is refused.",
      +  "title": "Speed By Height"
      +}
  2. Changed2 schema fields changedv1.5.1
    • changedInput schema / properties / brief_id / description
      Previous value: -"Default: \"\"."New value: +"Optional saved-goal id. When supplied it is recorded on the recipe before the rebuild, so the output carries the goal in its provenance; when omitted the recipe's existing goal is kept, so iterating a goal-attached design keeps it automatically. Default: \"\"."
    • addedInput schema / properties / recipe_path / description
      Added value: +"The design directory, or the recipe file."
  3. Changed2 schema fields changedv1.5.0
    • removedInput schema / properties / brief_id / default
      Removed value: -""
    • addedInput schema / properties / brief_id / description
      Added value: +"Default: \"\"."
  4. Addedv1.3.1

TDQS

A4.2/5.0
Behavior4/5

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

Well beyond the annotations, it discloses mode selection, that every parameter is itemized as applied/absent/skipped with a reason, and which artifact comes back (3MF vs merged G-code, indicated by 'wrapped'). It also documents the preview and the opt-in confirmation flags for refused slices. It is weaker on the destructive side of the destructiveHint=true annotation: it never says what a rebuild replaces or whether prior versions are overwritten, only that the slicer estimate is 'kept on the version'.

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?

The mode explanation is front-loaded and worth its length, but the six parameter blocks restate the schema word for word, and the appended INLINE 3D STAGE and MAKE DOORS sections are install-level boilerplate only loosely tied to rebuilding. Roughly a third of the text could be cut without losing rebuild-specific information.

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 contract itself and does so: a dict of artifact, named mode, per-parameter/per-part results, wrapped indicator, print_time and an optional inline preview. For a 6-parameter mutating tool it is close to self-sufficient; the remaining gap is the blast radius of the destructive rebuild.

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% and every parameter blurb in the description is a verbatim copy of the schema's own text, so no meaning is added. The genuinely interpretive content — that goal_id is written onto the recipe before the rebuild and that the slice flags are only for explicit user consent — is already in the schema descriptions. Baseline 3 for high coverage.

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?

The first line states a specific verb and resource ('Re-execute the full build pipeline from a saved design recipe') and then splits the behavior into two named modes chosen by recipe content. It explicitly separates itself from siblings by naming update_scad_parameter, rescale_model, thicken_mesh_walls and upload_file as the tools for the adjacent jobs.

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?

It gives a clear when-to-use rule plus an explicit prohibition: to resize a parametric design, change the parameter with update_scad_parameter and rebuild, and 'never scale the mesh instead', with the concrete failure mode (a 3mm wall becoming 3.6mm, a 3.4mm clearance hole becoming 4.08mm). For mesh-only recipes it routes to rescale_model/thicken_mesh_walls before rebuilding.

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