Skip to main content
Glama

save_design_version

Saves a new parametric design version, computes a diff from the previous version, and records provenance to track changes and warn about lost features.

Instructions

Save a new version of a parametric design.

        Automatically computes a unified diff from the previous version,
        increments the version number, and persists a versioned recipe
        sidecar (``~/.kiln/designs/<design_id>/.kiln_recipe.vN.json``).

        On Kiln Pro a save also fingerprints the mesh, warns when features
        are lost between versions, and writes a ``.kiln.json`` provenance
        sidecar that travels with the STL.

        Args:
            design_id: Identifier grouping versions of the same design.
            scad_source: Full OpenSCAD source code for this version.
            prompt: The natural-language prompt that produced this version.
            parameters: Parametric values used for generation.
            notes: Free-text notes for this version.
            provenance: Context on how this version was created.
                Recommended keys: ``tools_used``, ``change_summary``,
                ``source_files``.
            stl_path: Path to the output STL file.  When given, the
                version's mesh is fingerprinted and the reply warns if
                features were lost since the parent version.
            parent_version_id: Which earlier version the mesh
                fingerprint is compared against.  Omitted, the most
                recent existing version is the parent (and the source
                diff always uses that one).
            goal_id: Optional saved-goal id from ``design_session``.
                When supplied, the new version's recipe records the
                link so the audit's "matches what you asked for" gate,
                the brief failure_history wiring, and the
                ``compare_design_versions`` intent diff all join back
                to the goal.  When omitted, an earlier version's
                ``goal_id`` (read from the parent recipe) is
                inherited automatically.
            intent_hash: Optional content hash of the brief's derived
                intent payload, paired with ``goal_id``.  Same
                inheritance fall-back as ``goal_id``.
            gcode_path: Optional sliced file of this version (G-code, or
                a 3MF carrying a sliced plate).  The slicer's own time
                estimate in it is kept on the version, and the reply's
                ``print_time`` says it ("About 3h 1m, the slicer's
                estimate.").  A file stating no time keeps nothing.  A
                ``slicer_estimate`` in ``provenance`` is never kept: the
                estimate is read from the file.  The person's own speed
                ranges the file was sliced with (``speed_by_height``) are
                kept the same way, from Kiln's record of that slice on
                this computer, and the reply's ``sliced_speeds`` says
                them; a ``speed_by_height`` in ``provenance`` is never
                kept.

        Returns:
            The saved version record including version number, diff, and
            parent information.  Pro users also get provenance,
            mesh_fingerprint, and mesh_diff with regression warnings.
            A version saved with ``stl_path`` and a goal (named here or
            inherited) joins that goal in the person's Kiln account:
            ``saved_goal`` says whether it did, with the goal's
            ``safety_notes`` when it holds any, and for a model with
            separate parts ``motion`` says whether a stage plays it.  A
            version that could not join says why in ``saved_goal``; it
            is saved here either way.
        

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": {
      "design_id": "<design_id>",
      "scad_source": "<scad_source>"
    },
    "name": "save_design_version"
  }
}

Input Schema

NameRequiredDescriptionDefault
notesNoFree-text notes for this version. Default: "".
promptNoThe natural-language prompt that produced this version. Default: "".
goal_idNoOptional saved-goal id from ``design_session``. When supplied, the new version's recipe records the link so the audit's "matches what you asked for" gate, the brief failure_history wiring, and the ``compare_design_versions`` intent diff all join back to the goal. When omitted, an earlier version's ``goal_id`` (read from the parent recipe) is inherited automatically. Default: "".
stl_pathNoPath to the output STL file. When given, the version's mesh is fingerprinted and the reply warns if features were lost since the parent version. Default: "".
design_idYesIdentifier grouping versions of the same design.
gcode_pathNoOptional sliced file of this version (G-code, or a 3MF carrying a sliced plate). The slicer's own time estimate in it is kept on the version, and the reply's ``print_time`` says it ("About 3h 1m, the slicer's estimate."). A file stating no time keeps nothing. A ``slicer_estimate`` in ``provenance`` is never kept: the estimate is read from the file. The person's own speed ranges the file was sliced with (``speed_by_height``) are kept the same way, from Kiln's record of that slice on this computer, and the reply's ``sliced_speeds`` says them; a ``speed_by_height`` in ``provenance`` is never kept. Default: "".
parametersNoParametric values used for generation.
provenanceNoContext on how this version was created. Recommended keys: ``tools_used``, ``change_summary``, ``source_files``.
intent_hashNoOptional content hash of the brief's derived intent payload, paired with ``goal_id``. Same inheritance fall-back as ``goal_id``. Default: "".
scad_sourceYesFull OpenSCAD source code for this version.
parent_version_idNoWhich earlier version the mesh fingerprint is compared against. Omitted, the most recent existing version is the parent (and the source diff always uses that one). Default: "".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.6.0
    • removedInput schema / properties / brief_id
      Removed value: -{
      -  "description": "Optional saved-goal id from ``design_session``. When supplied, the new version's recipe records the link so the audit's \"matches what you asked for\" gate, the brief failure_history wiring, and the ``compare_design_versions`` intent diff all join back to the goal.  When omitted, an earlier version's ``brief_id`` (read from the parent recipe) is inherited automatically. Default: \"\".",
      -  "title": "Brief Id",
      -  "type": "string"
      -}
    • addedInput schema / properties / gcode_path
      Added value: +{
      +  "description": "Optional sliced file of this version (G-code, or a 3MF carrying a sliced plate).  The slicer's own time estimate in it is kept on the version, and the reply's ``print_time`` says it (\"About 3h 1m, the slicer's estimate.\").  A file stating no time keeps nothing.  A ``slicer_estimate`` in ``provenance`` is never kept: the estimate is read from the file.  The person's own speed ranges the file was sliced with (``speed_by_height``) are kept the same way, from Kiln's record of that slice on this computer, and the reply's ``sliced_speeds`` says them; a ``speed_by_height`` in ``provenance`` is never kept. Default: \"\".",
      +  "title": "Gcode Path",
      +  "type": "string"
      +}
    • addedInput schema / properties / goal_id
      Added value: +{
      +  "description": "Optional saved-goal id from ``design_session``. When supplied, the new version's recipe records the link so the audit's \"matches what you asked for\" gate, the brief failure_history wiring, and the ``compare_design_versions`` intent diff all join back to the goal.  When omitted, an earlier version's ``goal_id`` (read from the parent recipe) is inherited automatically. Default: \"\".",
      +  "title": "Goal Id",
      +  "type": "string"
      +}
    • changedInput schema / properties / intent_hash / description
      Previous value: -"Optional content hash of the brief's derived intent payload, paired with ``brief_id``.  Same inheritance fall-back as ``brief_id``. Default: \"\"."New value: +"Optional content hash of the brief's derived intent payload, paired with ``goal_id``.  Same inheritance fall-back as ``goal_id``. Default: \"\"."
  2. Changed10 schema fields changedv1.5.1
    • changedInput schema / properties / brief_id / description
      Previous value: -"Default: \"\"."New value: +"Optional saved-goal id from ``design_session``. When supplied, the new version's recipe records the link so the audit's \"matches what you asked for\" gate, the brief failure_history wiring, and the ``compare_design_versions`` intent diff all join back to the goal.  When omitted, an earlier version's ``brief_id`` (read from the parent recipe) is inherited automatically. Default: \"\"."
    • addedInput schema / properties / design_id / description
      Added value: +"Identifier grouping versions of the same design."
    • changedInput schema / properties / intent_hash / description
      Previous value: -"Default: \"\"."New value: +"Optional content hash of the brief's derived intent payload, paired with ``brief_id``.  Same inheritance fall-back as ``brief_id``. Default: \"\"."
    • changedInput schema / properties / notes / description
      Previous value: -"Default: \"\"."New value: +"Free-text notes for this version. Default: \"\"."
    • addedInput schema / properties / parameters / description
      Added value: +"Parametric values used for generation."
    • changedInput schema / properties / parent_version_id / description
      Previous value: -"Default: \"\"."New value: +"Which earlier version the mesh fingerprint is compared against.  Omitted, the most recent existing version is the parent (and the source diff always uses that one). Default: \"\"."
    • changedInput schema / properties / prompt / description
      Previous value: -"Default: \"\"."New value: +"The natural-language prompt that produced this version. Default: \"\"."
    • addedInput schema / properties / provenance / description
      Added value: +"Context on how this version was created. Recommended keys: ``tools_used``, ``change_summary``, ``source_files``."
    • addedInput schema / properties / scad_source / description
      Added value: +"Full OpenSCAD source code for this version."
    • changedInput schema / properties / stl_path / description
      Previous value: -"Default: \"\"."New value: +"Path to the output STL file.  When given, the version's mesh is fingerprinted and the reply warns if features were lost since the parent version. Default: \"\"."
  3. Changed14 schema fields changedv1.5.0
    • removedInput schema / properties / brief_id / default
      Removed value: -""
    • addedInput schema / properties / brief_id / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / intent_hash / default
      Removed value: -""
    • addedInput schema / properties / intent_hash / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / notes / default
      Removed value: -""
    • addedInput schema / properties / notes / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / parameters / default
      Removed value: -null
    • removedInput schema / properties / parent_version_id / default
      Removed value: -""
    • addedInput schema / properties / parent_version_id / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / prompt / default
      Removed value: -""
    • addedInput schema / properties / prompt / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / provenance / default
      Removed value: -null
    • removedInput schema / properties / stl_path / default
      Removed value: -""
    • addedInput schema / properties / stl_path / description
      Added value: +"Default: \"\"."
  4. First observedv0.1.0

TDQS

A3.9/5.0
Behavior5/5

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

Annotations only declare it is a non-read-only, non-destructive, closed-world write. The description goes well beyond that: it names the on-disk sidecar path (~/.kiln/designs/<design_id>/.kiln_recipe.vN.json), discloses automatic diffing and version-number increment, separates free vs Kiln Pro behavior (mesh fingerprinting, feature-loss warnings, .kiln.json provenance), and explains goal-link inheritance and the 'saved here either way' failure semantics. That is exactly the kind of side-effect and fallback disclosure annotations cannot carry.

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 purpose is front-loaded in the first sentence, but the body is bloated: eleven parameters are re-documented in prose that duplicates the schema, the gcode_path and goal_id passages repeat themselves ('never kept' twice, long conditional chains), and the Returns section runs long. Substantial trimming would lose no information the schema does not already hold.

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?

For an eleven-parameter mutation tool with no output schema, the description supplies what is needed: a Returns summary covering the version record, diff, parent, Pro-only fields, and the saved_goal/safety_notes/motion outcome including the partial-failure case. Combined with full schema coverage, an agent has enough to call it and interpret the reply.

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 Args block in the description is essentially verbatim duplication of the schema property descriptions, so it adds no meaning beyond the structured fields. Baseline 3 applies; the content is correct but redundant rather than additive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a specific verb and resource ('Save a new version of a parametric design') and immediately states what the save entails (diff, version increment, recipe sidecar). It does not, however, distinguish itself from siblings such as rollback_design_version, get_design_version, or best_design_version, so an agent must infer the boundary itself.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied rather than stated: the description makes clear this is the write path for a new version and explains conditional behaviors (stl_path triggers fingerprinting, goal_id is inherited when omitted), but it never says when to prefer this over rollback_design_version or when a save is inappropriate. No explicit when-not guidance or named alternative appears.

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