upload_gcode
Upload G-code content or a local file to a 3D printer. When printing, it inspects heater targets, tool changes, and material limits, then asks for confirmation.
Instructions
Upload G-code content or a local G-code file path to the printer. With print=true the exact uploaded bytes are inspected first (every S/R heater target, tool changes, hardware and material ceilings), printer state is checked, and a human confirmation is requested before the print starts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | Hostname or IP address of the printer (default: value from env) | |
| port | No | Port of the printer API (default: value from env) | |
| type | No | Type of printer management system (octoprint, klipper, duet, repetier, bambu, prusa, creality) (default: value from env) | |
| gcode | No | G-code content, or a local path to a G-code file. | |
| No | Start printing after upload when the printer backend supports it. Printing requires a declared material from slicer metadata (; filament_type = PLA) or the material argument. | ||
| api_key | No | API key for authentication (default: value from env) | |
| filename | No | Filename to use on the printer. Defaults to the basename of gcode_path when omitted. | |
| material | No | Declared filament material (for example PLA, PETG, ABS, ASA, TPU, PA, PC) when the G-code has no slicer filament_type metadata. Must not contradict the file. Material ceilings limit nozzle targets. | |
| gcode_path | No | Local path to a G-code file to upload. | |
| bambu_model | No | Required for Bambu print operations unless BAMBU_MODEL is configured. Must match the printer and pre-sliced G-code. | |
| bambu_token | No | Access token for Bambu Lab printers (default: value from env) | |
| bambu_serial | No | Serial number for Bambu Lab printers (default: value from env) |