slice_stl
Slice STL or 3MF files into printable G-code or sliced 3MF for the correct Bambu Lab printer model to produce safe output and report plate estimates, filament use, and warnings.
Instructions
Slice an STL or 3MF file using a slicer to generate printable G-code or sliced 3MF. Returns {output_path, plates:[{index, prediction_s, weight_g, filaments:[{type,color,used_g,used_m}], warnings:[{msg,level,error_code}]}]} (plates is empty for G-code output). Each slice writes into its own folder. IMPORTANT: bambu_model must be specified to ensure the slicer generates safe G-code for the correct printer. Call preflight_check first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Uniform scale factor applied to all axes. 1.0 = original size, 2.0 = double, 0.5 = half. Applied before slicing. | |
| orient | No | Auto-orient the model for optimal printability (minimize supports, maximize bed adhesion). Recommended for raw STL imports that lack a pre-set orientation. | |
| rotate | No | Rotate the model around the Z-axis (vertical) by this many degrees before slicing. Positive = counterclockwise when viewed from above. | |
| arrange | No | Auto-arrange all objects on the build plate with optimal spacing; STL input is arranged by default. Set false only to keep a 3MF's existing layout: an STL that is not already on the plate then fails to slice. | |
| bed_type | No | Bed plate type for slicing (default: textured_plate). SuperTack is rejected for CLI slicing until the BambuStudio CLI identifier is verified. | |
| min_save | No | Write a smaller output 3MF by omitting non-essential metadata. | |
| rotate_x | No | Rotate the model around the X-axis by this many degrees before slicing. Useful for reorienting prints for better layer adhesion. | |
| rotate_y | No | Rotate the model around the Y-axis by this many degrees before slicing. Useful for reorienting prints for better layer adhesion. | |
| stl_path | Yes | Path to the STL or 3MF file to slice | |
| uptodate | No | Refresh 3MF preset configs to match the latest BambuStudio version. Use when slicing downloaded or older 3MF files to prevent stale-config failures. | |
| bambu_model | Yes | REQUIRED: Bambu Lab printer model. Ask the user if not known. Using the wrong model can damage the printer. | |
| nozzle_type | No | Bambu-compatible slicing: the hotend nozzle material installed on the printer (default: BAMBU_NOZZLE_TYPE, else the model preset's stock nozzle, usually stainless_steel). | |
| repetitions | No | Print N identical copies of the model. Each copy gets its own plate placement. Example: 3 prints three copies. | |
| slice_plate | No | Which plate index to slice. 0 = all plates (default). Use 1, 2, etc. to slice only a specific plate in multi-plate 3MF projects. | |
| slicer_path | No | Path to the slicer executable (default: value from env). Per-call overrides require MCP_ALLOW_EXECUTABLE_ARG=1. | |
| slicer_type | No | Type of slicer to use. bambustudio exports a sliced 3MF. | |
| skip_objects | No | Skip specific objects during slicing by index. Comma-separated, e.g. '3,5,10'. Useful for multi-object 3MFs where you only want to print some parts. | |
| template_dir | No | Optional template directory override when resolving template_name. | |
| clone_objects | No | Clone the loaded model: total copies as a single integer, e.g. '3'. The Bambu-style CLIs count copies per input file and this tool loads one file, so a comma-separated list is rejected by the slicer. | |
| ensure_on_bed | No | Detect models floating above the bed and lower them onto the build surface. Safety net for imported models with incorrect Z origins. | |
| template_name | No | Optional named template from the local registry. Resolves to template_3mf_path automatically. | |
| allow_mix_temp | No | Allow filaments with different temperature requirements on the same plate. Required for multi-material prints mixing e.g. PLA and PETG. | |
| load_filaments | No | Override filament profiles. Semicolon-separated paths to filament JSON configs, e.g. 'pla_basic.json;petg_cf.json'. | |
| slicer_profile | No | Path to an optional process profile/config file. The exact bambu_model/nozzle machine preset is still required. | |
| nozzle_diameter | No | Nozzle diameter in mm (default: 0.4) | |
| enable_timelapse | No | Insert timelapse parking moves into gcode. The toolhead parks at a fixed position each layer for camera capture. Adds ~10% print time. | |
| filament_colours | No | Optional slot colours, one #RRGGBB per filament slot in order, separated by ';' (e.g. '#161616;#FFFFFF'). Defaults to the input 3MF's project colours, else the BambuStudio default. | |
| filament_profile | No | Compatibility alias for load_filaments. Semicolon-separated Bambu filament profile JSON paths. | |
| project_settings | No | 3MF input without a slicer profile or template: "keep" slices with the settings the project's creator saved (changed process settings, and each filament mapped to the bambu_model's equivalent preset); "printer_default" uses the printer's default process and filament. When omitted, the user is asked; if the client cannot ask, the call fails and you must ask the user, then pass this. The result's settings_report lists what was kept and not kept. | |
| load_filament_ids | No | Map filaments to objects/parts. Comma-separated IDs matching load_filaments order, e.g. '1,2,3,1' assigns filament 1 to objects 0 and 3. | |
| template_3mf_path | No | Optional template 3MF whose embedded Bambu slicer settings should be reused when slicing a new STL or 3MF. | |
| nozzle_volume_type | No | Bambu-compatible slicing: the flow type of the nozzle installed on the printer (default: BAMBU_NOZZLE_VOLUME_TYPE, else standard). high_flow uses the presets' High Flow values, such as the filament's High Flow max volumetric speed, and is refused if the machine preset has no High Flow variant. | |
| skip_modified_gcodes | No | Strip custom start/end gcodes embedded in the 3MF. Recommended for downloaded 3MFs since custom gcodes from other users' profiles may be unsafe for your printer model. | |
| use_printer_filaments | No | Default false. When true, a printer is configured, and no explicit slicer profile or load_filaments override is provided, replace the filaments with the printer's current or first loaded AMS filament. Template 3MF process settings can still be used at the same time. |