Skip to main content
Glama

optimize_print_orientation

Destructive

Rotates STL meshes to reduce overhangs and increase bed contact, selecting a candidate orientation and placing the model flat on the build plate for improved printability.

Instructions

Auto-rotate a mesh to minimize overhangs and maximize bed contact.

        Tests multiple candidate orientations and picks the one with the
        fewest overhangs and the most bed contact.  Re-orients the mesh
        and places it flat on the build plate (z_min = 0).

        ``printability_score`` / ``printability_grade`` are the chosen
        orientation's score from ``analyze_printability`` itself, judged
        for ``material`` and ``printer_id`` — pass the same ones you
        gave ``analyze_printability`` and the two numbers match.

        :param file_path: Path to the STL file.
        :param output_path: Output path.  Defaults to overwriting the input.
        :param material: Material the score is judged for (default ``"pla"``).
        :param printer_id: Optional printer the score is judged for.
        :returns: Dict with rotation angles, overhang stats, the
            printability score and grade, and new 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": "optimize_print_orientation"
  }
}

Input Schema

NameRequiredDescriptionDefault
materialNoMaterial the score is judged for (default ``"pla"``). Default: "pla".
file_pathYesPath to the STL file.
printer_idNoOptional printer the score is judged for. Default: "".
output_pathNoOutput path. Defaults to overwriting the input. Default: "".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.5.1
    • addedInput schema / properties / file_path / description
      Added value: +"Path to the STL file."
    • changedInput schema / properties / material / description
      Previous value: -"Default: \"pla\"."New value: +"Material the score is judged for (default ``\"pla\"``). Default: \"pla\"."
    • changedInput schema / properties / output_path / description
      Previous value: -"Default: \"\"."New value: +"Output path.  Defaults to overwriting the input. Default: \"\"."
    • changedInput schema / properties / printer_id / description
      Previous value: -"Default: \"\"."New value: +"Optional printer the score is judged for. Default: \"\"."
  2. Changed4 schema fields changedv1.5.0
    • addedInput schema / properties / material
      Added value: +{
      +  "description": "Default: \"pla\".",
      +  "title": "Material",
      +  "type": "string"
      +}
    • removedInput schema / properties / output_path / default
      Removed value: -""
    • addedInput schema / properties / output_path / description
      Added value: +"Default: \"\"."
    • addedInput schema / properties / printer_id
      Added value: +{
      +  "description": "Default: \"\".",
      +  "title": "Printer Id",
      +  "type": "string"
      +}
  3. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, and the description supplies the key context behind it: output_path defaults to overwriting the input file. It also discloses non-obvious side effects — the interactive 3D stage panel opening on success, a browser stage link fallback for hosts without MCP Apps, and automatic decimation of oversized meshes for the stage. Only error/failure behavior is left unstated.

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 opening two sentences are tight and front-load the purpose and algorithm, but the block re-documents every :param: and :returns: entry that the schema already covers verbatim, and the inline-3D-stage paragraph is long relative to its informational payload. Content is good but the structure duplicates structured data.

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 mutating tool with no output schema, the description covers the important ground: the returned dict contents are enumerated (rotation angles, overhang stats, printability score and grade, new dimensions), the destructive default is spelled out, and the viewer side effect is disclosed. It lacks any failure/mode note, which keeps it short of complete.

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 adds real meaning on top by explaining that ``material`` and ``printer_id`` are not free-form settings but must match whatever was passed to ``analyze_printability`` for the returned score to be comparable. That cross-tool consistency constraint is not expressible in the schema itself.

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?

The description gives a specific verb and resource plus an explicit optimization objective: 'Auto-rotate a mesh to minimize overhangs and maximize bed contact,' and explains the selection algorithm (tests candidates, picks fewest overhangs / most bed contact). It does not differentiate from the very similar siblings auto_orient_model, center_model_on_bed, or check_orientation, so an agent cannot tell from this text alone which orienting tool to pick.

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

Usage Guidelines3/5

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

There is useful usage guidance in the form of a coupling rule: pass the same ``material`` and ``printer_id`` given to ``analyze_printability`` so the two scores match. However, there is no statement of when to use this versus auto_orient_model or check_orientation, no prerequisites (e.g., mesh must be manifold), and no exclusions.

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