Skip to main content
Glama

Send G-code to Printer

send_to_printer
Destructive

Use this when you need to upload a .gcode file (e.g. written by export with target: "model", format: "gcode") to a real network printer and, by default, start the print. protocol: 'octoprint' (POST /api/files/local with an X-Api-Key), 'moonraker' (Klipper's POST /server/files/upload), or 'bambu-lan' (Bambu Lab LAN-mode: FTPS implicit-TLS upload on port 990 as user 'bblp' with the printer's LAN access code, then an MQTT print-start command on port 8883 — requires access_code and, unless start_print is false, serial). bambu-lan uploads a .gcode.3mf print project (the printer prints 3MF projects, not bare G-code): the G-code goes in as Metadata/plate_1.gcode, inside the model 3MF from export format '3mf' when model_3mf_path is given (use options { arrange: 'plate', slicer: 'bambu' } so the printer shows the same named, coloured parts), else inside a minimal 3MF shell; the file name always ends in .3mf ('part.gcode' -> 'part.gcode.3mf'). Optional printer (a bundled profile id, the same ids as the export 3mf/gcode options.printer) is checked against protocol before anything is read or sent: an unknown id is refused with the list of valid ids, 'bambu-lan' needs a Bambu Lab profile and a Bambu Lab profile needs 'bambu-lan'. Pass { dry_run: true } to validate connectivity/authentication only, without uploading or starting a print. Never logs or echoes api_key/access_code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostYesPrinter hostname or IP.
portNoOverride the protocol default port.
serialNoBambu printer serial number (required to start a print unless start_print is false).
api_keyNoOctoPrint API key (Settings -> API).
dry_runNoValidate connectivity/auth only; never uploads or starts a print.
printerNoPrinter profile id; checked against protocol before upload. List them with 'kernelcad print printers'.
filenameNoUploaded file name (default: 'kernelcad.gcode'; bambu-lan appends '.3mf').
protocolYes
gcode_pathYesPath to the .gcode file on disk.
access_codeNoBambu LAN-mode access code (printer settings -> LAN Only Mode).
start_printNoStart the print immediately after upload (default: true).
model_3mf_pathNobambu-lan only: model .3mf from export format '3mf' to package the G-code into (the uploaded .gcode.3mf).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "diagnostics": {
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "dry_run": {
      -    "description": "True when only connectivity/auth was validated (no upload, no print start).",
      -    "type": "boolean"
      -  },
      -  "error": {
      -    "type": "string"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  },
      -  "uploaded_path": {
      -    "description": "Path/name the G-code (bambu-lan: the .gcode.3mf print file) was stored under on the printer.",
      -    "type": "string"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed4 schema fields changed
    • changedInput schema / properties / filename / description
      Previous value: -"Uploaded file name (default: 'kernelcad.gcode')."New value: +"Uploaded file name (default: 'kernelcad.gcode'; bambu-lan appends '.3mf')."
    • addedInput schema / properties / model_3mf_path
      Added value: +{
      +  "description": "bambu-lan only: model .3mf from export format '3mf' to package the G-code into (the uploaded .gcode.3mf).",
      +  "type": "string"
      +}
    • addedInput schema / properties / printer
      Added value: +{
      +  "description": "Printer profile id; checked against protocol before upload. List them with 'kernelcad print printers'.",
      +  "enum": [
      +    "generic-fdm",
      +    "bambu-a1-mini",
      +    "bambu-a1",
      +    "bambu-p1s",
      +    "bambu-p1p",
      +    "bambu-x1c",
      +    "bambu-x1e",
      +    "bambu-h2d",
      +    "bambu-h2s",
      +    "prusa-mini-plus",
      +    "prusa-mk4s",
      +    "prusa-core-one",
      +    "prusa-xl",
      +    "creality-ender-3-v3",
      +    "creality-k1",
      +    "creality-k1-max",
      +    "creality-k2-plus",
      +    "elegoo-neptune-4-pro",
      +    "anycubic-kobra-3",
      +    "voron-2.4-250",
      +    "voron-2.4-300",
      +    "voron-2.4-350",
      +    "ultimaker-s5"
      +  ],
      +  "type": "string"
      +}
    • changedOutput schema / properties / uploaded_path / description
      Previous value: -"Path/name the G-code was stored under on the printer."New value: +"Path/name the G-code (bambu-lan: the .gcode.3mf print file) was stored under on the printer."
  3. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.