Skip to main content
Glama

upload_file

Destructive

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

NameRequiredDescriptionDefault
file_pathYesAbsolute 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_nameNoWhich 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.5.1
    • addedInput schema / properties / file_path / description
      Added value: +"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."
    • addedInput schema / properties / printer_name / description
      Added value: +"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."
  2. Changed1 schema field changedv1.5.0
    • removedInput schema / properties / printer_name / default
      Removed value: -null
  3. Changed1 schema field changedv1.3.1
    • addedInput schema / properties / printer_name
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Printer Name"
      +}
  4. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false and destructiveHint=true, so the safety profile is partly covered. The description adds useful behavior: automatic FTPS/REST/serial handling, dialect scanning, bed-fit gating, and extension refusal before upload. It does not explain what destructive action might occur, such as overwriting an existing file, or whether confirmation is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and post-upload workflow are front-loaded, which helps scanning. However, the full Args section duplicates the input schema descriptions verbatim, inflating the text without adding information beyond the structured fields.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter tool with complete schema descriptions and annotations, the description covers file-type constraints, printer selection behavior, transport handling, and the next step after upload. It is not fully complete because it omits overwrite/destructive semantics and the confirmation relationship with upload_file_confirm.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, and the description's Args block repeats the schema parameter descriptions almost verbatim. It adds no new parameter-level meaning beyond what the schema already provides, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names the exact action and resource: uploading a local G-code file to a printer. It also states the supported transport mechanisms. However, it does not explicitly differentiate this tool from the sibling upload_file_confirm, which prevents a top score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete guidance for Bambu versus OctoPrint/Moonraker/PrusaLink/Duet files, including when to use wrap_gcode_as_3mf first and when to trust slice_model's recommended_upload_path. It clearly says the uploaded file can then be started with start_print, though it does not explain when upload_file_confirm is required.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools