Skip to main content
Glama

extract_model_from_3mf

Extracts the embedded 3D model from a .3mf or .gcode.3mf file and writes it to binary STL for slicing or multi-copy printing. Merges multiple mesh objects into one file.

Instructions

Extract the embedded 3D model from a .3mf or .gcode.3mf file to STL.

        3MF files are ZIP archives containing XML mesh geometry.  This tool
        parses the embedded model, extracts all mesh objects, and writes a
        binary STL file ready for slicing, multi-copy printing, or further
        mesh operations.

        .. note::
            For extracting a single object's **G-code** from a multi-object
            Bambu .gcode.3mf file, use ``extract_plate_object`` instead.
            Use ``list_plate_objects`` to discover available objects.

        Works with both standard 3MF files and Bambu Studio .gcode.3mf files
        (which bundle both G-code and the source model).  When multiple
        objects exist they are merged into a single STL.

        :param file_path: Path to the .3mf or .gcode.3mf file.
        :param output_path: Output STL path (auto-generated if empty).
        :returns: Dict with output path, triangle/vertex counts, and dimensions.

INLINE 3D STAGE: on success this tool opens Kiln's interactive 3D stage — an inline viewer panel the user can orbit, zoom, and turn over — in hosts that render MCP Apps panels (Kiln's hosted connection attaches a browser stage link for hosts that don't). Oversized meshes are decimated automatically for the stage; the PNG preview is the floor, not the whole experience.

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": "extract_model_from_3mf"
  }
}

Input Schema

NameRequiredDescriptionDefault
file_pathYesPath to the .3mf or .gcode.3mf file.
output_pathNoOutput STL path (auto-generated if empty). Default: "".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.5.1
    • addedInput schema / properties / file_path / description
      Added value: +"Path to the .3mf or .gcode.3mf file."
    • changedInput schema / properties / output_path / description
      Previous value: -"Default: \"\"."New value: +"Output STL path (auto-generated if empty). Default: \"\"."
  2. Changed2 schema fields changedv1.5.0
    • removedInput schema / properties / output_path / default
      Removed value: -""
    • addedInput schema / properties / output_path / description
      Added value: +"Default: \"\"."
  3. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=false, openWorldHint=false), the description discloses real behavior: multiple objects are merged into a single STL, the output path is auto-generated when empty, and the inline 3D stage opens with automatic decimation for oversized meshes. It does not state whether an existing output file is overwritten, which is the one material gap for a tool that writes to disk.

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 core sentence is front-loaded and the routing note comes early, which is the right order. However, the RST :param:/:returns: block duplicates schema fields, and the inline-stage paragraph is long relative to the rest, diluting the tight structure.

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, but the :returns: line specifies the return shape (output path, triangle/vertex counts, dimensions). Format support, merge behavior, and the UI side effect are all covered, so an agent has everything needed to call it correctly.

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%, so both parameters are already documented in the schema and the description's :param: lines largely restate them. The 'auto-generated if empty' default behavior is repeated rather than extended. Baseline 3 is appropriate when the schema carries the semantics.

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?

States a specific verb and resource ('Extract the embedded 3D model from a .3mf or .gcode.3mf file to STL') and explains the mechanism (ZIP archive with XML mesh geometry, parsed and written as binary STL). It explicitly distinguishes itself from the sibling tools extract_plate_object and list_plate_objects.

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?

The note gives an explicit alternative with the exact condition that selects it: for extracting a single object's G-code from a multi-object Bambu .gcode.3mf, use extract_plate_object; use list_plate_objects to discover objects. It also names the downstream uses (slicing, multi-copy printing, further mesh ops).

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