Skip to main content
Glama

scale_mesh_to_fit

Destructive

Auto-scale an STL mesh to fit a printer’s build volume while preserving aspect ratio, reducing oversized models until they fit.

Instructions

Auto-scale a mesh to fit within a build volume while maintaining aspect ratio.

        Useful when a model is too large for your printer -- this uniformly
        shrinks it to the largest size that fits.

        :param file_path: Path to mesh file (.stl).
        :param max_x_mm: Maximum X dimension of build volume.
        :param max_y_mm: Maximum Y dimension of build volume.
        :param max_z_mm: Maximum Z dimension of build volume.
        :param printer_id: Optional printer: a supported model id, or the
            name of a printer set up in Kiln.  When provided, its recorded
            build volume replaces the explicit dimensions.
        :param output_path: Output path. Defaults to overwriting input.
        :returns: Dict with original/new dimensions and scale factor.

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

Input Schema

NameRequiredDescriptionDefault
max_x_mmNoMaximum X dimension of build volume. Default: 256.0.
max_y_mmNoMaximum Y dimension of build volume. Default: 256.0.
max_z_mmNoMaximum Z dimension of build volume. Default: 256.0.
file_pathYesPath to mesh file (.stl).
printer_idNoOptional printer: a supported model id, or the name of a printer set up in Kiln. When provided, its recorded build volume replaces the explicit dimensions. Default: "".
output_pathNoOutput path. Defaults to overwriting input. Default: "".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.5.1
    • addedInput schema / properties / file_path / description
      Added value: +"Path to mesh file (.stl)."
    • changedInput schema / properties / max_x_mm / description
      Previous value: -"Default: 256.0."New value: +"Maximum X dimension of build volume. Default: 256.0."
    • changedInput schema / properties / max_y_mm / description
      Previous value: -"Default: 256.0."New value: +"Maximum Y dimension of build volume. Default: 256.0."
    • changedInput schema / properties / max_z_mm / description
      Previous value: -"Default: 256.0."New value: +"Maximum Z dimension of build volume. Default: 256.0."
    • changedInput schema / properties / output_path / description
      Previous value: -"Default: \"\"."New value: +"Output path. Defaults to overwriting input. Default: \"\"."
    • changedInput schema / properties / printer_id / description
      Previous value: -"Default: \"\"."New value: +"Optional printer: a supported model id, or the name of a printer set up in Kiln.  When provided, its recorded build volume replaces the explicit dimensions. Default: \"\"."
  2. Changed10 schema fields changedv1.5.0
    • removedInput schema / properties / max_x_mm / default
      Removed value: -256
    • addedInput schema / properties / max_x_mm / description
      Added value: +"Default: 256.0."
    • removedInput schema / properties / max_y_mm / default
      Removed value: -256
    • addedInput schema / properties / max_y_mm / description
      Added value: +"Default: 256.0."
    • removedInput schema / properties / max_z_mm / default
      Removed value: -256
    • addedInput schema / properties / max_z_mm / description
      Added value: +"Default: 256.0."
    • removedInput schema / properties / output_path / default
      Removed value: -""
    • addedInput schema / properties / output_path / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / printer_id / default
      Removed value: -""
    • addedInput schema / properties / printer_id / description
      Added value: +"Default: \"\"."
  3. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, and the description earns credit for explaining why: output_path "Defaults to overwriting input." It also discloses the return shape and the interactive-stage behavior, including automatic decimation of oversized meshes for the viewer. It stops short of saying whether the original file is backed up or where the scale factor is recorded.

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 sentence is well front-loaded, but the docstring-style :param list restates schema text that is already 100% covered, and the returns line duplicates information the caller can infer. The inline-stage paragraph is long and partly redundant with the PNG-preview framing, so several sentences do not fully earn their place.

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 6-parameter mutation tool with no output schema, the description covers the key interactions: printer_id superseding explicit dimensions, the overwrite-by-default hazard, and the returned dict contents. The main omission is what happens to the source mesh when output_path is omitted.

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 the schema already documents every parameter, including the printer_id override of explicit dimensions and the output_path overwrite default. The description's :param block largely repeats that text, adding little new meaning beyond the aspect-ratio preservation rule.

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?

States a specific verb+resource+constraint: auto-scales a mesh to fit a build volume while preserving aspect ratio, plus the effect (uniform shrink to largest fitting size). It is clearly distinct from split_mesh_to_fit, but it never distinguishes itself from the sibling rescale_model, which an agent could easily confuse with this tool.

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 a concrete when-to-use condition ("when a model is too large for your printer"). It does not name alternatives such as rescale_model for a fixed scale factor or split_mesh_to_fit for models that must be divided rather than shrunk, so the routing guidance is clear but not complete.

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