slice_and_print
Slices and prints a 3D model in one step, validating mesh printability and adding brim or raft as needed so designs that would fail are blocked before reaching the printer.
Instructions
Slice a 3D model (STL/3MF) + upload + print in one step (basic pipeline).
``version_id`` / ``design_id`` / ``branch_id`` name the kept design
this file came from, when there is one: the print's record then
lands on that version's history (what printed, on which machine,
how it ended) instead of on a bare file name. A file that is
not a Kiln design passes none and is recorded by file alone.
``account_sync_id`` is the id the print's record already has on
the person's Kiln account, when the door that sent the print
opened it there first; agents leave it unset.
Colour is a promise kept here. A part made in a colour (the
``color`` the make was asked for, or the one its source named)
prints from a loaded spool of that colour: on a printer with an
AMS the slot is chosen and named in the result; with none of that
colour loaded the print is HELD (``code: "COLOR_NOT_LOADED"``),
naming the nearest loaded spool, so the person decides before
anything prints -- call again with ``color="<that colour>"`` to
print in it, or load the asked colour and call again; on a
printer with no unit Kiln can read it prints in whatever is
loaded and the result says so. ``color`` here overrides the
make's: a colour word or hex to print in instead, or ``"any"``
to print in whatever is loaded.
For a more comprehensive pipeline with validation and profile auto-detection,
use ``run_quick_print``. For custom slicer overrides, use ``run_reslice_and_print``.
Automatically analyzes bed adhesion and adds brim/raft when needed
based on model geometry, material warp tendency, and printer type.
This adhesion intelligence only activates when no custom profile is
supplied; when it could not read the model, ``printability_note``
says why. A skirt that would print past the edge of the bed is
dropped and the part sliced again; a brim that would is refused
with the width that fits.
Pre-print validation gate: mesh inputs (.stl/.obj/.3mf/.step/.glb)
run through Kiln's full validation pipeline before slicing —
format check, watertight check, auto-repair, printability scoring
(0-100), bed-fit, and material checks. Designs that fail the gate
are blocked before reaching the printer; auto-repaired meshes are
sliced from the repaired path. Pass ``skip_validation=True`` to
bypass (e.g. for already-validated meshes or pre-sliced 3MFs).
Args:
input_path: Path to the 3D model file (STL, 3MF, STEP, etc.).
printer_name: Target printer name. Omit for the default printer.
profile: Path to a slicer profile/config file.
printer_id: Optional printer model ID for bundled profile
auto-selection (e.g. ``"prusa_mini"``).
material: Filament material (e.g. ``"PLA"``, ``"ABS"``). It
sets the slice's temperatures, melt rate and cooling
(``build_material_overrides`` shows them), its density
weighs the print, and it steers the automatic brim/raft
decision. Omitted, the spool the printer reports loaded
answers, then PLA — the response's ``slice.filament``
says which.
metadata: Optional pass-through fields for a printable
assembly manual made beside the print. Recognised keys
(all optional): ``assembly_json``, ``manual_output_dir``,
``manual_design_name``, ``manual_branding``,
``manual_co_brand_name``, ``manual_languages``,
``manual_cover_language``. The manual, when one is
made, is returned under ``assembly_manual``; keys a plan
does not include are accepted and ignored.
skip_validation: Bypass the pre-print validation gate.
Defaults to False — designs are pre-tested for
printability before they reach the printer. Set to
True only when the caller has already validated the
mesh (e.g. ``validate_and_prepare`` was just called)
or when the input is a pre-sliced 3MF the validator
can't introspect.
placement: Where the part goes when the plate still holds the
last print: ``[x, y]`` in mm (the part's footprint
origin), a named region (``"front-left"``, ``"centre"``,
``"back-right"``, …), or ``"keep"``. Omitted, an
occupied plate refuses before anything is sliced and
lists the spots that would work; a clear plate prints as
before. The response's ``placement`` block is the
clearance verdict, checked again on the sliced file
before upload. The clearance verdict is always given;
placing and starting a second print on an occupied
plate is included where the plan carries it.
hardware: Bought parts that go into the part while it
prints, as short phrases such as ``["4x 6x3 magnet",
"2x M3 nut"]``. The file that prints carries the pause
Kiln's servers wrote into it, and the response's
``hardware`` block says what goes in and when; a part
that needs a pause that cannot be written is refused
before anything is sent to the printer. Left out, a
part with a pocket that would be sealed inside the
print is refused with ``HARDWARE_UNNAMED`` and the
planner's question for each pocket ("this hex pocket
takes an M3 nut -- right?"): ask the person, then call
again with what they said, or ``["none"]`` to print
every pocket empty on their word. ``["none"]`` with a
pause already in the sliced file over a sealed pocket
is refused as a contradiction (``HARDWARE_NONE_BUT_PAUSED``).
The pause is written where the plan carries it.
auto_center: Centre the model on the plate before slicing
(default ``True``). ``False`` keeps the model where its
file places it.
preview_token: Token from ``issue_preview_token`` proving this
model was shown to the person before printing. Required
beside their go-ahead: a print is shown to its owner
before it starts.
color: The colour to print in, overriding the make's: a colour
word or hex, or ``"any"`` to print in whatever is loaded.
Omitted, the colour the part was made in is matched to a
loaded spool, or the print is held.
version_id: The kept design version this file came from, so
the print's record lands on that version's history. A
file that is not a Kiln design passes none.
design_id: The design that version belongs to; passed with
``version_id``.
branch_id: The branch that version is on; passed with
``version_id``.
account_sync_id: The id the print's record already has on the
person's Kiln account, when the door that sent the print
opened it there first. Agents leave it unset.
Combines ``slice_model``, ``upload_file``, and ``start_print`` into
a single action.
Branch on ``print_start`` — one field, three values, and the
nested ``print`` block carries the identical pair so the two
halves cannot disagree:
- ``"started"``: the printer, asked after the command, is printing.
- ``"accepted"``: the command was sent and not refused, and the
machine has not confirmed it is running. Normal during the
start-up transient (homing, AMS load, calibration). Call
``printer_status()`` to watch it start.
- ``"failed"``: the printer, asked after the command, is idle or
errored — it did not take the job.
``success`` is ``False`` only for ``"failed"``.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_and_print"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| color | No | The colour to print in, overriding the make's: a colour word or hex, or ``"any"`` to print in whatever is loaded. Omitted, the colour the part was made in is matched to a loaded spool, or the print is held. Default: "". | |
| profile | No | Path to a slicer profile/config file. | |
| hardware | No | Bought parts that go into the part while it prints, as short phrases such as ``["4x 6x3 magnet", "2x M3 nut"]``. The file that prints carries the pause Kiln's servers wrote into it, and the response's ``hardware`` block says what goes in and when; a part that needs a pause that cannot be written is refused before anything is sent to the printer. Left out, a part with a pocket that would be sealed inside the print is refused with ``HARDWARE_UNNAMED`` and the planner's question for each pocket ("this hex pocket takes an M3 nut -- right?"): ask the person, then call again with what they said, or ``["none"]`` to print every pocket empty on their word. ``["none"]`` with a pause already in the sliced file over a sealed pocket is refused as a contradiction (``HARDWARE_NONE_BUT_PAUSED``). The pause is written where the plan carries it. | |
| material | No | Filament material (e.g. ``"PLA"``, ``"ABS"``). It sets the slice's temperatures, melt rate and cooling (``build_material_overrides`` shows them), its density weighs the print, and it steers the automatic brim/raft decision. Omitted, the spool the printer reports loaded answers, then PLA — the response's ``slice.filament`` says which. | |
| metadata | No | Optional pass-through fields for a printable assembly manual made beside the print. Recognised keys (all optional): ``assembly_json``, ``manual_output_dir``, ``manual_design_name``, ``manual_branding``, ``manual_co_brand_name``, ``manual_languages``, ``manual_cover_language``. The manual, when one is made, is returned under ``assembly_manual``; keys a plan does not include are accepted and ignored. | |
| branch_id | No | The branch that version is on; passed with ``version_id``. | |
| design_id | No | The design that version belongs to; passed with ``version_id``. | |
| placement | No | Where the part goes when the plate still holds the last print: ``[x, y]`` in mm (the part's footprint origin), a named region (``"front-left"``, ``"centre"``, ``"back-right"``, …), or ``"keep"``. Omitted, an occupied plate refuses before anything is sliced and lists the spots that would work; a clear plate prints as before. The response's ``placement`` block is the clearance verdict, checked again on the sliced file before upload. 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 3D model file (STL, 3MF, STEP, etc.). | |
| printer_id | No | Optional printer model ID for bundled profile auto-selection (e.g. ``"prusa_mini"``). | |
| version_id | No | The kept design version this file came from, so the print's record lands on that version's history. A file that is not a Kiln design passes none. | |
| auto_center | No | Centre the model on the plate before slicing (default ``True``). ``False`` keeps the model where its file places it. Default: true. | |
| printer_name | No | Target printer name. Omit for the default printer. | |
| preview_token | No | Token from ``issue_preview_token`` proving this model was shown to the person before printing. Required beside their go-ahead: a print is shown to its owner before it starts. | |
| account_sync_id | No | The id the print's record already has on the person's Kiln account, when the door that sent the print opened it there first. Agents leave it unset. | |
| skip_validation | No | Bypass the pre-print validation gate. Defaults to False — designs are pre-tested for printability before they reach the printer. Set to True only when the caller has already validated the mesh (e.g. ``validate_and_prepare`` was just called) or when the input is a pre-sliced 3MF the validator can't introspect. Default: false. |