Skip to main content
Glama

rebuild_design

Destructive

Re-execute a saved design recipe to re-derive parametric geometry or re-slice meshes, producing a print-ready 3MF or G-code artifact.

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.

        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 brief_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.
        :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
brief_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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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."
  2. Changed2 schema fields changedv1.5.0
    • removedInput schema / properties / brief_id / default
      Removed value: -""
    • addedInput schema / properties / brief_id / description
      Added value: +"Default: \"\"."
  3. Addedv1.3.1

TDQS

A4.4/5.0
Behavior4/5

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

Adds substantial behavior beyond the annotations: output artifact varies (print-ready 3MF vs merged G-code) with a `wrapped` flag, every parameter is itemized as applied/absent/skipped, and inline previews may appear but never gate the rebuild. What it does not state is the overwrite semantics implied by destructiveHint=true — which existing artifacts or caches get replaced — leaving the agent without a clear risk statement.

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 action and cleanly bulleted by mode, with the return contract near the end. It runs long, and the italicized MAKE DOORS paragraph about design_session/compile_scad is toolchain orientation rather than rebuild-specific instruction, but nothing is truly wasted.

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?

No output schema exists, so the description carries the return contract and does: "Dict with the print artifact, the mode used, and per-part or per-parameter results," plus the `wrapped` discriminator. For a two-parameter tool with full schema coverage, an agent has everything needed to call it and interpret 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 description coverage is 100%, and the description's `:param` blocks restate the schema text almost verbatim (brief_id's provenance behavior, recipe_path's "directory or recipe file"). The only added value is the usage example path, so this sits at the baseline for schema-complete tools.

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+resource: "Re-execute the full build pipeline from a saved design recipe," then splits into two named modes (Parametric vs Mesh) so an agent can predict which path runs. It explicitly distinguishes itself from neighbors like update_scad_parameter, rescale_model, thicken_mesh_walls, and upload_file, so the agent can route correctly without opening the 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 explicit when-to-use rules per mode: change the parameter (not scale the mesh) for parametric designs, and do a mesh edit first for mesh designs, including a concrete failure rationale (3mm wall becoming 3.6mm, M3 clearance becoming 4.08mm). It also names the downstream step for G-code output (upload_file) and states when the preview is informational only.

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