unload_filament
Pull filament out of the hotend: returns it to the AMS on Bambu printers or heats and retracts on Klipper, readying the nozzle for the next material.
Instructions
Pull filament out of the hotend — back into the AMS on Bambu, a heated retract elsewhere.
Same temperature gate, verification, ``outcome`` vocabulary and wait
bound as ``load_filament``: on Bambu ``extrusion_verified`` is ``True``
once the AMS reports no tray feeding the nozzle (``tray_now`` 255); on
Klipper an ``UNLOAD_FILAMENT`` / ``M702`` macro is used when the config
has one; otherwise the hotend is heated and ``length_mm`` is retracted
(default 80).
Args:
material: e.g. ``"PLA"`` -- picks a temperature when none is given
and no spool report supplies one, as ``load_filament``.
temperature: Hotend target in °C. Omit to use the middle of the
spool's or material's window.
length_mm: Retract distance for the generic G-code path (default
80). Ignored where the firmware's own routine decides.
wait_seconds: How long to watch for the AMS to confirm, bounded as
in ``load_filament``.
keep_hot: Leave the heater ON afterwards. Off by default: unload
never retracts at the end (the filament is already out) but
still turns the heater off unless this asks otherwise.
printer_name: Which printer. Omit for the default one.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "unload_filament"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keep_hot | No | Leave the heater ON afterwards. Off by default: unload never retracts at the end (the filament is already out) but still turns the heater off unless this asks otherwise. Default: false. | |
| material | No | e.g. ``"PLA"`` -- picks a temperature when none is given and no spool report supplies one, as ``load_filament``. | |
| length_mm | No | Retract distance for the generic G-code path (default 80). Ignored where the firmware's own routine decides. | |
| temperature | No | Hotend target in °C. Omit to use the middle of the spool's or material's window. | |
| printer_name | No | Which printer. Omit for the default one. | |
| wait_seconds | No | How long to watch for the AMS to confirm, bounded as in ``load_filament``. |