Skip to main content
Glama

multi_material_print

Destructive

Prints multiple objects in different materials or colors on one build plate by building a multi-material 3MF, mapping AMS slots, slicing, and sending the job to a supported printer.

Instructions

Print multiple objects in different materials/colors on one build plate.

**Only a printer Kiln drives can make this print** — today a Bambu with
an AMS.  At any other printer (a Klipper MMU Kiln can read but not
route, or a single-feed machine) a multi-filament plate is REFUSED
before slicing with code ``MULTI_MATERIAL_NOT_DRIVEN``: the objects
would all come out in one filament.  The refusal carries what Kiln saw
on the printer (``multi_material``) and the composed file
(``multi_material_3mf``), so the user can slice it in a slicer that
drives their unit.  A single-filament plate is never refused.

Takes a JSON array of objects, each with a model file and material
assignment. Builds a multi-material 3MF file with per-object filament
assignments, slices it, auto-maps materials to AMS slots, and prints.

This is how you print "object A in red PLA, object B in black PETG"
in a single print job.

Example: Print a bracket in PETG and a cover in PLA::

    multi_material_print(
        objects_json='[
            {"file_path": "/path/to/bracket.stl", "material_id": "petg"},
            {"file_path": "/path/to/cover.stl", "material_id": "pla"}
        ]',
        printer_name="my_bambu",
        printer_id="bambu_a1",
    )

Each object in the JSON array supports:
    - ``file_path`` (required): Path to STL/OBJ/GLB mesh file.
    - ``material_id`` (required): Material identifier (e.g. ``"petg"``).
    - ``name`` (optional): Display name for the object.
    - ``color`` (optional): Hex color override (e.g. ``"#FF0000"``).
    - ``group`` (optional): Objects sharing a group index are placed
      coincident (for meshes that share one coordinate space, like a
      body and its inlay). By default every object is its own group
      and gets its own spot on the plate.

The tool automatically:
    1. Looks up each material's properties (temps, colors)
    2. Arranges the objects side by side on the plate (per ``group``)
       and builds a multi-object 3MF with per-object material assignments
    3. Sets the plate for its materials: the hottest one's temperatures,
       the slowest one's melt rate, the gentlest cooling.  On a printer
       sliced with more than one nozzle each filament keeps its own
       material's temperatures
    4. Checks AMS slots for matching materials
    5. Slices and prints with correct AMS mapping

Requires PrusaSlicer or OrcaSlicer installed locally.

The emitted 3MF (``multi_material_3mf`` in the result) also opens in
Bambu Studio, which keeps the per-object materials but re-derives
print settings itself — the result's ``slicer_note`` explains this;
relay it to the user when handing over the file.

Args:
    objects_json: JSON array of objects, each
        ``{"file_path": …, "material_id": …}`` (STL/OBJ/GLB path;
        material key such as ``"petg"``), with optional ``name``,
        ``color`` (hex) and ``group`` (objects sharing a group index
        are placed coincident).
    printer_name: Registered printer name in fleet.
    printer_id: Printer model ID for profile selection.
    auto_ams: Match each filament to a loaded spool of its material and
        colour before slicing (default ``True``); refused when one is not
        loaded.
    extra_overrides: Optional JSON object of slicer overrides merged on
        top of the material settings (e.g.
        ``'{"fill_density": "30%"}'``).
    slicer_path: Explicit path to slicer binary.
    preview_token: Token from ``issue_preview_token`` on the plate a
        call without one built (``plate_path``), proving it was shown to
        the person before printing.  The call carrying it prints that
        plate, for the same objects, once the person says go: a print
        is shown to its owner before it starts.
    filament_map: Only for a printer with more than one nozzle: the
        nozzle (1 for the first) each filament prints from, one number
        per filament (``[2, 1]`` puts filament 1 on nozzle 2).  Filaments
        are numbered in the order their objects first appear in
        ``objects_json``, one per material and colour (the result's
        ``filament_index`` is that number less one).  Leave unset to let
        the slicer map them.  A map that does not fit is refused before
        slicing, as ``slice_model`` refuses it.
    mixed_nozzle_experiment: The person has said yes, for this print, to a slice refused with
        ``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an experiment). Only
        on their yes, each time; ``slice_model`` says what follows.
    soft_nozzle_confirmed: The owner has said to print anyway a slice
        refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive filament
        through a nozzle on record that is not wear-resistant).  Only on
        their word, never on your own judgement.

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": {
      "objects_json": "<objects_json>"
    },
    "name": "multi_material_print"
  }
}

Input Schema

NameRequiredDescriptionDefault
auto_amsNoMatch each filament to a loaded spool of its material and colour before slicing (default ``True``); refused when one is not loaded. Default: true.
printer_idNoPrinter model ID for profile selection.
slicer_pathNoExplicit path to slicer binary.
filament_mapNoOnly for a printer with more than one nozzle: the nozzle (1 for the first) each filament prints from, one number per filament (``[2, 1]`` puts filament 1 on nozzle 2). Filaments are numbered in the order their objects first appear in ``objects_json``, one per material and colour (the result's ``filament_index`` is that number less one). Leave unset to let the slicer map them. A map that does not fit is refused before slicing, as ``slice_model`` refuses it.
objects_jsonYesJSON array of objects, each ``{"file_path": …, "material_id": …}`` (STL/OBJ/GLB path; material key such as ``"petg"``), with optional ``name``, ``color`` (hex) and ``group`` (objects sharing a group index are placed coincident).
printer_nameNoRegistered printer name in fleet.
preview_tokenNoToken from ``issue_preview_token`` on the plate a call without one built (``plate_path``), proving it was shown to the person before printing. The call carrying it prints that plate, for the same objects, once the person says go: a print is shown to its owner before it starts.
extra_overridesNoOptional JSON object of slicer overrides merged on top of the material settings (e.g. ``'{"fill_density": "30%"}'``).
soft_nozzle_confirmedNoThe owner has said to print anyway a slice refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive filament through a nozzle on record that is not wear-resistant). Only on their word, never on your own judgement. Default: false.
mixed_nozzle_experimentNoThe person has said yes, for this print, to a slice refused with ``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an experiment). Only on their yes, each time; ``slice_model`` says what follows. Default: false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.6.0
    • changedInput schema / properties / auto_ams / description
      Previous value: -"Auto-detect AMS slot mapping (default ``True``). Default: true."New value: +"Match each filament to a loaded spool of its material and colour before slicing (default ``True``); refused when one is not loaded. Default: true."
    • addedInput schema / properties / filament_map
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "integer"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Only for a printer with more than one nozzle: the nozzle (1 for the first) each filament prints from, one number per filament (``[2, 1]`` puts filament 1 on nozzle 2).  Filaments are numbered in the order their objects first appear in ``objects_json``, one per material and colour (the result's ``filament_index`` is that number less one).  Leave unset to let the slicer map them.  A map that does not fit is refused before slicing, as ``slice_model`` refuses it.",
      +  "title": "Filament Map"
      +}
    • addedInput schema / properties / mixed_nozzle_experiment
      Added value: +{
      +  "description": "The person has said yes, for this print, to a slice refused with ``MULTI_NOZZLE_MIXED_SIZES`` (nozzles of different sizes at once, an experiment). Only on their yes, each time; ``slice_model`` says what follows. Default: false.",
      +  "title": "Mixed Nozzle Experiment",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / preview_token / description
      Previous value: -"Token from ``issue_preview_token`` proving the plate was shown to the person before printing.  Required beside their go-ahead: a print is shown to its owner before it starts."New value: +"Token from ``issue_preview_token`` on the plate a call without one built (``plate_path``), proving it was shown to the person before printing.  The call carrying it prints that plate, for the same objects, once the person says go: a print is shown to its owner before it starts."
    • addedInput schema / properties / soft_nozzle_confirmed
      Added value: +{
      +  "description": "The owner has said to print anyway a slice refused with ``ABRASIVE_ON_SOFT_NOZZLE`` (an abrasive filament through a nozzle on record that is not wear-resistant).  Only on their word, never on your own judgement. Default: false.",
      +  "title": "Soft Nozzle Confirmed",
      +  "type": "boolean"
      +}
  2. Changed7 schema fields changedv1.5.1
    • changedInput schema / properties / auto_ams / description
      Previous value: -"Default: true."New value: +"Auto-detect AMS slot mapping (default ``True``). Default: true."
    • addedInput schema / properties / extra_overrides / description
      Added value: +"Optional JSON object of slicer overrides merged on top of the material settings (e.g. ``'{\"fill_density\": \"30%\"}'``)."
    • addedInput schema / properties / objects_json / description
      Added value: +"JSON array of objects, each ``{\"file_path\": …, \"material_id\": …}`` (STL/OBJ/GLB path; material key such as ``\"petg\"``), with optional ``name``, ``color`` (hex) and ``group`` (objects sharing a group index are placed coincident)."
    • addedInput schema / properties / preview_token / description
      Added value: +"Token from ``issue_preview_token`` proving the plate was shown to the person before printing.  Required beside their go-ahead: a print is shown to its owner before it starts."
    • addedInput schema / properties / printer_id / description
      Added value: +"Printer model ID for profile selection."
    • addedInput schema / properties / printer_name / description
      Added value: +"Registered printer name in fleet."
    • addedInput schema / properties / slicer_path / description
      Added value: +"Explicit path to slicer binary."
  3. Changed10 schema fields changedv1.5.0
    • removedInput schema / properties / auto_ams / default
      Removed value: -true
    • addedInput schema / properties / auto_ams / description
      Added value: +"Default: true."
    • changedInput schema / properties / extra_overrides / anyOf
      Previous value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / extra_overrides / default
      Removed value: -null
    • addedInput schema / properties / objects_json / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +]
    • removedInput schema / properties / objects_json / type
      Removed value: -"string"
    • addedInput schema / properties / preview_token
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "title": "Preview Token"
      +}
    • removedInput schema / properties / printer_id / default
      Removed value: -null
    • removedInput schema / properties / printer_name / default
      Removed value: -null
    • removedInput schema / properties / slicer_path / default
      Removed value: -null
  4. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description goes well beyond that: it enumerates the exact refusal codes and what they carry, the five-step automatic pipeline (material lookup, arrangement, plate settings, AMS check, slice/print), the multi-nozzle temperature exception, and the conflict cases where mixed_nozzle_experiment or soft_nozzle_confirmed override a refusal. It does not describe what happens on partial failure or how long the print blocks, which keeps it just short of the top mark.

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, prerequisites, and pipeline are strongly front-loaded, but the trailing 'Args:' block reproduces the input schema nearly verbatim, so a large fraction of a very long description carries no information the agent cannot already read in the schema. The nested sub-bullets under objects_json further duplicate what is said three paragraphs earlier.

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?

For a 10-parameter, destructive, printer-gated tool with no output schema, the definition covers everything an agent needs: hardware preconditions, the exact refusal codes to relay, the human-approval gates, the multi-nozzle mapping rules, external dependencies (PrusaSlicer/OrcaSlicer), and the Bambu Studio caveat with its slicer_note handoff instruction.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns one more by explaining the non-obvious semantics rather than restating types — group indices placing objects coincident, filament numbering following first appearance order in objects_json with filament_index being that number minus one, and auto_ams being 'refused when one is not loaded'. The worked example also disambiguates that objects_json accepts a JSON string.

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?

Opens with a precise verb+resource: 'Print multiple objects in different materials/colors on one build plate,' and the plain-language gloss ('object A in red PLA, object B in black PETG') removes any ambiguity against siblings like multi_copy_print or multi_color_copies, which copy one object rather than assigning materials per object.

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

Usage Guidelines5/5

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

It states the hard precondition for use (a printer Kiln drives, today a Bambu with an AMS) and explicitly names when NOT to use it — a Klipper MMU or single-feed machine is refused with MULTI_MATERIAL_NOT_DRIVEN — plus the fallback the user should take in that case. It further documents the preview_token gating flow and which sibling (slice_model) supplies the refusal semantics for nozzle parameters.

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