Save G-code and record the slice
save_gcodePersist the latest sliced G-code with its full settings snapshot under a unique filename, so later print outcomes can be linked to the exact slice. Returns the saved path for starting the print.
Instructions
Save the last successful slice's G-code and record the slice (model, geometry, full settings snapshot) under that filename, so that when klipper-mcp later prints this exact file the real outcome joins back to these settings. Returns the saved path; hand it to klipper-mcp's start_print. Default filename: _.gcode. Never overwrites an existing file — a name collision gets a -2, -3, ... suffix. Writes into a gcode folder under PRINT_OUTCOMES_DIR if set, else under the shared print-outcomes folder (~/projects/_shared/print-outcomes) if it already exists, else under ~/.orcaslicer-mcp; the gcode folder itself is created if missing. If the shared outcome store is not present, or the store write fails, the file is still saved and outcome_recorded is False.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No |