Save G-code and record the slice
save_gcodeSave the last sliced G-code to a file while recording its model, settings, and estimates so later print results can be matched back to the slice. Returns the file path for printer tools.
Instructions
Save the last slice's G-code to a file and record the slice so the print can be learned from later; hand the path to the printer tools.
The record (model, a fingerprint of the objects' names and sizes, full settings snapshot, and OrcaSlicer's time and filament estimates) goes in the local outcome store under that filename. When that file is printed, list_print_history (or klipper-mcp's recorder) matches the finished job by filename, so the real result 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 ~/.orcaslicer-mcp; the folder is created if missing. If the store write fails, the file is still saved and outcome_recorded is False.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "save_gcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No |