slice_model
Slice STL, 3MF, STEP, or OBJ models into G-code with PrusaSlicer or OrcaSlicer, auto-centering off-bed meshes and checking bed clearance before output.
Instructions
Slice a 3D model (STL/3MF/STEP) to G-code using PrusaSlicer or OrcaSlicer.
Args:
input_path: Path to the input file (STL, 3MF, STEP, OBJ, AMF).
output_dir: Directory for the output G-code. Defaults to
the system temp directory.
profile: Path to a slicer profile/config file (.ini or .json).
printer_id: Optional printer model ID for bundled profile
auto-selection (e.g. ``"prusa_mini"``).
slicer_path: Explicit path to the slicer binary. Auto-detected
if omitted.
material: Filament material for this slice (``"PLA"``,
``"PETG"``, ``"TPU"``, …, or a product such as
``"bambu_tpu_95a"``). It sets the slice's temperatures,
melt rate and cooling -- Kiln's settings for it on this
printer, see ``build_material_overrides`` -- and its
density weighs the print. Omitted, the spool the printer
reports loaded answers, then PLA; the response's
``filament`` block says which, and ``filament.settings``
what the slice was set to and why.
auto_center: When True (default), off-bed STLs are translated
to a bed-centered copy before slicing. This prevents the
class of crash where origin-centered meshes (common from
compose_part_from_primitives / OpenSCAD output) produce
sliced gcode with negative X/Y moves that drive the
nozzle into the printer frame. Set False only if you've
verified the input is already correctly positioned.
A part too big for the bed as modelled is also turned a
quarter turn when that makes it fit — an STL directly,
a STEP file as Kiln's mesh of it — and the response's
``bed_fit`` block says so.
printer_name: Registered printer this slice is FOR. Omit for
the default printer. Naming a second machine resolves
its profile, its bed and its safety limits — without it,
a multi-printer install slices everything for whichever
printer is the default.
placement: Where the part goes when the plate still holds the
last print. ``[x, y]`` in mm (where the part's footprint
origin lands), a named region (``"front-left"``,
``"centre"``, ``"back-right"``, …), or ``"keep"`` to leave
it where the file puts it. Omitted, an occupied plate
refuses and lists the spots that would work; a clear
plate slices as before. The response's ``placement``
block is the clearance verdict, and the sliced file is
checked against the plate once more before it is handed
on. The clearance verdict is always given; placing and
starting a second print on an occupied plate is included
where the plan carries it.
A bundled profile is sliced for the nozzle fitted to the machine --
the nozzle on record for it, else the printer's own setting --
rather than the model's stock size. The response's ``nozzle``
block names the size, where it came from and what was changed to
suit it; tell the user when it is not the stock size.
Returns a JSON object with the output G-code path. The output file
can then be uploaded to a printer with ``upload_file`` and printed
with ``start_print``. A skirt that would print past the edge of
the bed is dropped and the part sliced again (``bed_fit``'s
``skirt_dropped`` says so); a brim that would is refused
(``BRIM_PAST_BED``) with the width that fits.INLINE 3D STAGE: on success this tool opens Kiln's interactive 3D stage — an inline viewer panel the user can orbit, zoom, and turn over — in hosts that render MCP Apps panels (Kiln's hosted connection attaches a browser stage link for hosts that don't). Oversized meshes are decimated automatically for the stage; the PNG preview is the floor, not the whole experience.
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": {
"input_path": "<input_path>"
},
"name": "slice_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | Path to a slicer profile/config file (.ini or .json). | |
| material | No | Filament material for this slice (``"PLA"``, ``"PETG"``, ``"TPU"``, …, or a product such as ``"bambu_tpu_95a"``). It sets the slice's temperatures, melt rate and cooling -- Kiln's settings for it on this printer, see ``build_material_overrides`` -- and its density weighs the print. Omitted, the spool the printer reports loaded answers, then PLA; the response's ``filament`` block says which, and ``filament.settings`` what the slice was set to and why. | |
| placement | No | Where the part goes when the plate still holds the last print. ``[x, y]`` in mm (where the part's footprint origin lands), a named region (``"front-left"``, ``"centre"``, ``"back-right"``, …), or ``"keep"`` to leave it where the file puts it. Omitted, an occupied plate refuses and lists the spots that would work; a clear plate slices as before. The response's ``placement`` block is the clearance verdict, and the sliced file is checked against the plate once more before it is handed on. The clearance verdict is always given; placing and starting a second print on an occupied plate is included where the plan carries it. | |
| input_path | Yes | Path to the input file (STL, 3MF, STEP, OBJ, AMF). | |
| output_dir | No | Directory for the output G-code. Defaults to the system temp directory. | |
| printer_id | No | Optional printer model ID for bundled profile auto-selection (e.g. ``"prusa_mini"``). | |
| auto_center | No | When True (default), off-bed STLs are translated to a bed-centered copy before slicing. This prevents the class of crash where origin-centered meshes (common from compose_part_from_primitives / OpenSCAD output) produce sliced gcode with negative X/Y moves that drive the nozzle into the printer frame. Set False only if you've verified the input is already correctly positioned. A part too big for the bed as modelled is also turned a quarter turn when that makes it fit — an STL directly, a STEP file as Kiln's mesh of it — and the response's ``bed_fit`` block says so. Default: true. | |
| slicer_path | No | Explicit path to the slicer binary. Auto-detected if omitted. | |
| printer_name | No | Registered printer this slice is FOR. Omit for the default printer. Naming a second machine resolves its profile, its bed and its safety limits — without it, a multi-printer install slices everything for whichever printer is the default. |