Skip to main content
Glama

load_filament

Feed filament to the nozzle — an AMS tray on Bambu, a manual feed elsewhere.

Instructions

Feed filament to the nozzle — an AMS tray on Bambu, a manual feed elsewhere.

On Bambu Lab the firmware's own change-filament routine runs (retract,
feed, purge) and the answer is read from the AMS: ``extrusion_verified``
is ``True`` once ``tray_now`` reports the tray feeding the nozzle,
``False`` with the fault code in plain language if the routine raised
one (the same HMS codes the touchscreen shows), ``None`` if neither
arrived in ``wait_seconds``.  On Klipper a ``LOAD_FILAMENT`` / ``M701``
macro from the printer's own config is used when it exists; otherwise,
and on OctoPrint / Duet / serial, the hotend is heated and
``length_mm`` is fed at 3 mm/s — push the filament into the extruder
first.

Temperature is checked against the printer's safety profile, the
spool's own ``nozzle_temp_min/max`` (AMS) or Kiln's material table,
and the 170 °C cold-extrusion floor; refused outside any of them.
Refused while a print is running (paused is fine).

Branch on ``outcome`` — one field, three values, the same shape
``set_temperature`` and ``start_print`` use:

- ``"confirmed"``: the printer showed the effect (the AMS reports the
  tray feeding the nozzle).
- ``"accepted"``: the command was sent and not refused, and the printer
  has not shown the effect yet.  A Bambu load takes a minute or two
  and a tool call cannot wait that long, so this is the normal answer
  when the watch runs out: the routine is still running.  Do NOT send
  the load again — read ``next_read`` (``ams_status`` for ``tray_now``,
  ``printer_status`` for ``print_error``) to finish the answer.
- ``"failed"``: the gate or the printer refused, or a fault was raised
  (``error_code`` / ``error_hint``).

On Bambu Lab that check binds what Kiln sends, not what the routine
does: the firmware heats to its own flush temperature for a filament
change (250 °C observed on an A1 asked for 215, the ``M109 S250`` its
own start sequence sets) and drops to the requested target only when
the routine finishes.  The answer reports the temperature the firmware
actually used (``firmware_hotend_target_c``) beside the one Kiln
validated; the gate is not widened to match it.

Where the declared model's own purge position is served one plan at a time through Kiln's hosted service for a printer paired to your Kiln sign-in, free, and kept on your machine so it works offline, the head is parked over the purge chute
before the routine runs, so its purge falls into the chute instead of
hanging off the nozzle at home; the answer says where the head was
either way.

Args:
    slot: The printer's own tray id, as ``ams_status`` lists it in
        ``tray_id`` (0–3 on unit A, 4–7 on unit B, 128 for the AMS HT
        named HT-A).  Omit for the external / single spool.
    material: e.g. ``"PLA"`` — picks a temperature when none is given
        and no spool report supplies one.
    temperature: Hotend target in °C.  Omit to use the middle of the
        spool's or material's window.
    length_mm: Feed distance for the generic G-code path (default 60;
        bowden machines need more).  Ignored where the firmware's own
        routine decides.
    wait_seconds: How long to watch for the AMS to confirm.  Bounded to
        what a tool call can wait inside the client's request window
        (40 s unless ``KILN_FILAMENT_WAIT_BUDGET_S`` says otherwise); a
        longer ask is applied at the bound and the response says so.
    keep_hot: Leave the heater ON afterwards, for a caller about to do
        something else hot.  Off by default: every op ends with the
        heater off and says so; where the machine's own cool-down is
        served, the part fan goes on and Kiln turns it off on its own
        once the nozzle reads the hand-off temperature -- the answer
        does not wait for that, and ``printer_status`` shows it.
    printer_name: Which printer.  Omit for the default one.

Input Schema

NameRequiredDescriptionDefault
slotNo
keep_hotNoDefault: false.
materialNo
length_mmNo
temperatureNo
printer_nameNo
wait_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.5.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so thoroughly: it discloses firmware-routine behavior, AMS verification via tray_now/extrusion_verified, fault-code handling, temperature safety gates, cold-extrusion floor, print-running refusal, outcome semantics, and the important warning that a Bambu load may return accepted while still running.

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

Conciseness4/5

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

The description is front-loaded and well-structured, with outcome semantics and Args organized clearly. It is long and includes some tangential detail about the hosted purge service, but most content is relevant for a complex, multi-platform printer operation.

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

Completeness5/5

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

There is no output schema, no annotations, and low schema coverage, so the description must carry the definition. It covers purpose, platform branches, safety constraints, outcome values, next_read guidance, error fields, and all parameters, making it complete enough for an agent to invoke and interpret the tool correctly.

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

Parameters5/5

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

Schema description coverage is only 14%, but the description compensates with a detailed Args section: slot IDs and ranges, material/temperature selection logic, length_mm default and when it is ignored, wait_seconds bounding with KILN_FILAMENT_WAIT_BUDGET_S, keep_hot consequences, and printer_name default behavior. This adds substantial meaning beyond the bare schema.

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

Purpose5/5

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

The opening sentence states a specific verb and resource: 'Feed filament to the nozzle', and immediately distinguishes the Bambu AMS path from the manual-feed path elsewhere. An agent can tell this is the loading counterpart to unload_filament/purge_filament without opening the schema.

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?

The description gives clear operational context: it explains Bambu vs Klipper vs generic paths, states that loading is refused while a print is running (paused is fine), and explicitly says 'Do NOT send the load again' when outcome is accepted. It does not name sibling tools as alternatives, which keeps it below a perfect 5.

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