upload_file
Upload a local G-code file to a 3D printer, automatically choosing FTPS, REST multipart, or serial transfer. The file then appears on the printer, ready to print.
Instructions
Upload a local G-code file to the printer.
Handles FTPS (Bambu), REST multipart upload (OctoPrint/Moonraker), and
serial file transfer automatically.
Args:
file_path: Absolute path to the print file on the local filesystem.
The file must exist and be readable. Accepted extensions follow
the TARGET PRINTER, not one fixed list — ``printer_status()``
reports them per machine, and a Bambu declares ``.3mf`` FIRST
because that is the only thing it will start a print from.
Bare ``.gcode`` / ``.gco`` / ``.g`` is right for OctoPrint,
Moonraker, PrusaLink and Duet; on a Bambu it has no start block
and is refused before anything is sent (wrap it with
``wrap_gcode_as_3mf`` first).
When ``slice_model`` produced the file, upload the path it names
in ``recommended_upload_path`` and do not choose between its
outputs by hand — it already knows the printer.
printer_name: Which printer to upload to. Omit for the default
printer. The G-code dialect scan and the bed-fit gate follow the
named machine too, so the bytes are checked against the bed
they are actually going to.
After a successful upload the file will appear in ``printer_files()`` and
can be started with ``start_print()``.
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": {
"file_path": "<file_path>"
},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the print file on the local filesystem. The file must exist and be readable. Accepted extensions follow the TARGET PRINTER, not one fixed list — ``printer_status()`` reports them per machine, and a Bambu declares ``.3mf`` FIRST because that is the only thing it will start a print from. Bare ``.gcode`` / ``.gco`` / ``.g`` is right for OctoPrint, Moonraker, PrusaLink and Duet; on a Bambu it has no start block and is refused before anything is sent (wrap it with ``wrap_gcode_as_3mf`` first). When ``slice_model`` produced the file, upload the path it names in ``recommended_upload_path`` and do not choose between its outputs by hand — it already knows the printer. | |
| printer_name | No | Which printer to upload to. Omit for the default printer. The G-code dialect scan and the bed-fit gate follow the named machine too, so the bytes are checked against the bed they are actually going to. |