Skip to content

Slicing Tools ​

Note: the verified workflow is to slice in Bambu Studio (GUI) and feed the resulting .gcode.3mf to print_3mf. The CLI-driven slicing tools below (slice_stl, slice_with_template) work but are sensitive to profile drift and are not the recommended path for production prints. See slicing guide.

list_templates ​

List saved templates from the local registry directory. You can override the registry root with BAMBU_TEMPLATE_DIR.

json
{}

Each result includes the template name, absolute path, source type, and relative path inside the registry. You can then pass template_name to get_slice_settings, slice_stl, or print_3mf instead of a raw path.

save_template ​

Copy a local 3mf, json, or .config file into the template registry and register it under a reusable template name.

json
{
  "source_path": "/path/to/sliced_project.3mf",
  "template_name": "collars/p1p_petg_default"
}

This creates the destination under the template registry directory and makes it available immediately to list_templates, get_slice_settings, slice_with_template, slice_stl, and print_3mf.

get_slice_settings ​

Inspect the slicer settings embedded in a saved 3MF template or in an extracted JSON/config profile without slicing anything.

json
{
  "template_name": "h2s_template"
}

This returns a compact summary of the high-signal settings such as printer preset, default print profile, filament profiles, layer height, infill density, shell counts, support mode, and bed type. It accepts either source_path or template_name. For 3MF inputs it also writes the extracted settings blob to a temp path so the result can be reused directly.

slice_with_template ​

Slice an STL or 3MF using a named template from the local registry. This is a higher-level wrapper over slice_stl for template-based workflows.

json
{
  "stl_path": "/path/to/model.stl",
  "template_name": "collars/p1p_petg_default",
  "bambu_model": "p1p"
}

This uses the named template as the slicing profile source and still supports live printer filament selection unless you explicitly override load_filaments. The template settings are applied at slice time, and the later print_3mf step computes H2-safe AMS mapping from the newly sliced output.

slice_stl ​

Slice an STL or 3MF file using an external slicer and return the path to the output file. The output is a sliced 3MF (for BambuStudio, OrcaSlicer, and FULU OrcaSlicer-bambulab) or a G-code file (for PrusaSlicer, Cura, Slic3r).

json
{
  "stl_path": "/path/to/model.stl",
  "slicer_type": "bambustudio",
  "bambu_model": "p1s"
}

slicer_type options: bambustudio, orcaslicer, orcaslicer-bambulab (FULU), prusaslicer, cura, slic3r. Aliases include fulu-orca and orca-studio. When omitted, the value from the SLICER_TYPE environment variable is used (default: bambustudio).

FULU/Orca CLI safety: from 1.1.11, these backends require the exact model/nozzle preset from the selected installation and stop on profile preparation failures. A process override cannot bypass that gate. See configuration and validation limits.

slicer_path and slicer_profile fall back to the SLICER_PATH and SLICER_PROFILE environment variables when omitted. Per-call slicer_path overrides require MCP_ALLOW_EXECUTABLE_ARG=1.

You can provide either template_3mf_path or template_name when you want to slice from a saved template. template_name resolves through the local template registry directory configured for the server.

For printing on a Bambu printer, the recommended workflow is: export a sliced 3MF from your selected Bambu-compatible slicer, then pass that output path to print_3mf.

BambuStudio Slicer Options ​

When slicer_type is bambustudio (the default), these additional parameters are available on slice_stl:

ParameterTypeDescription
uptodatebooleanUpdate 3MF configs to latest BambuStudio presets
repetitionsnumberNumber of copies to print
orientbooleanAuto-orient model for optimal printability
arrangebooleanAuto-arrange objects on the build plate
ensure_on_bedbooleanLift floating models onto the bed
clone_objectsstringClone counts per object, comma-separated (e.g. "1,3,1,10")
skip_objectsstringObject indices to skip, comma-separated (e.g. "3,5,10")
load_filamentsstringFilament profile paths, semicolon-separated
load_filament_idsstringFilament-to-object mapping, comma-separated
filament_coloursstringSlot colours, one #RRGGBB per filament slot, semicolon-separated. Explicit values take priority, followed by input 3MF colours, each custom profile's colour, then the BambuStudio default.
enable_timelapsebooleanEnable timelapse-aware slicing
allow_mix_tempbooleanAllow mixed-temperature filaments on one plate
scalenumberUniform scale factor
rotatenumberZ-axis rotation in degrees
rotate_xnumberX-axis rotation in degrees
rotate_ynumberY-axis rotation in degrees
min_savebooleanProduce smaller output 3MF (faster uploads)
skip_modified_gcodesbooleanIgnore stale custom gcodes in the 3MF
slice_platenumberWhich plate to slice (0 = all plates, default: 0)

Example: Slice with auto-orient and 3 copies

json
{
  "stl_path": "/path/to/model.stl",
  "bambu_model": "p1s",
  "orient": true,
  "arrange": true,
  "repetitions": 3
}

Smart Defaults (print_3mf auto-slice) ​

When print_3mf detects an unsliced 3MF and auto-slices it, these defaults are applied automatically:

  • uptodate: true -- prevents stale config bugs from downloaded 3MFs
  • ensure_on_bed: true -- safety net, lifts floating models onto the bed
  • min_save: true -- smaller output for faster FTP uploads to the printer
  • skip_modified_gcodes: true -- strips custom gcodes from other users' profiles

These defaults reduce stale-profile problems; inspect downloaded models and their slice preview before printing. When calling slice_stl directly, you have full control over every flag.

Released under the GPL-2.0 license. An independent open-source project, not affiliated with Bambu Lab.