slice_with_template
Slices STL or 3MF files using a named local template to automate repeatable Bambu print workflows. Use it for template-based slicing so saved settings apply without rebuilding them each time.
Instructions
Slice an STL or 3MF using a named template from the local registry. This is a higher-level wrapper around slice_stl for template-based workflows.
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": {
"stl_path": "<stl_path>",
"template_name": "<template_name>",
"bambu_model": "<bambu_model>"
},
"name": "slice_with_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | Hostname or IP of the printer (default: value from env) | |
| scale | No | Uniform scale factor. | |
| orient | No | Auto-orient model for optimal printability. | |
| rotate | No | Z-axis rotation in degrees. | |
| arrange | No | Auto-arrange objects on the build plate. | |
| bed_type | No | Bed plate type for slicing (default: textured_plate). | |
| min_save | No | Produce smaller output 3MF. | |
| rotate_x | No | X-axis rotation in degrees. | |
| rotate_y | No | Y-axis rotation in degrees. | |
| stl_path | Yes | Path to the STL or 3MF file to slice | |
| bambu_model | Yes | REQUIRED: Bambu Lab printer model. Ask the user if not known. Using the wrong model can damage the printer. | |
| bambu_token | No | Access token (default: value from env) | |
| 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). Printing compares it with the printer's reported nozzle. | |
| repetitions | No | Total copies of an STL, using clone_objects internally. Do not also pass clone_objects. The slicer may place copies on multiple plates; print_3mf prints one selected plate per call. For 3MF input, select slice_plate explicitly. | |
| slice_plate | No | Which plate index to slice. 0 = all plates. | |
| 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. Bambu-compatible choices (bambustudio, orcaslicer, orcaslicer-bambulab) export sliced 3MF; aliases such as fulu-orca and orca-studio are accepted. | |
| bambu_serial | No | Serial number (default: value from env) | |
| template_dir | No | Optional template directory override when resolving template_name. | |
| ensure_on_bed | No | Lift floating models onto the bed. | |
| template_name | Yes | Named template from the local registry. | |
| load_filaments | No | Override filament profiles. Semicolon-separated paths to filament JSON configs. | |
| slicer_profile | No | Explicit slicer profile/config file. Overrides the named template only when provided in the tool call. | |
| nozzle_diameter | No | Nozzle diameter in mm (default: 0.4) | |
| pause_at_layers | No | Pause before each of these layers (1-based, as Bambu Studio and OrcaSlicer number them in the preview), for example to drop in magnets or nuts. The slicer writes the printer's own pause G-code there (M400 U1 on Bambu printers); the printer stops by itself and waits for Resume. Bambu Studio or OrcaSlicer CLI only. Pauses already in a project 3MF are kept. | |
| 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. | |
| load_filament_ids | No | Optional filament-to-object mapping string. | |
| 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. Printing compares it with the printer's reported nozzle flow. | |
| skip_modified_gcodes | No | Ignore stale custom gcodes in the 3MF. | |
| use_printer_filaments | No | When true, and no explicit slicer profile or load_filaments override is provided, use the printer's current or first loaded AMS filament as the slicer filament profile. |