Skip to main content
Glama

scale_mesh_to_fit

Destructive

Shrinks a 3D mesh uniformly to fit your printer's build volume while preserving aspect ratio, making oversized models printable without manual rescaling.

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;
            ``step_path`` is the resized CAD when the part's CAD file
            sat beside it, so a CAD part stays a CAD part.

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.9/5.0
Behavior4/5

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

The annotations already flag destructiveHint=true, and the description usefully explains the mechanism: output_path 'Defaults to overwriting input', which tells the agent exactly what data is at risk. It also goes well beyond the annotations by disclosing the inline 3D stage, the automatic decimation for oversized meshes, and that CAD parts remain CAD via step_path. It stops short of stating whether the original file can be recovered, which is the one remaining gap for a destructive write.

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 lead sentence and the 'useful when' clause are well front-loaded and earn their place, as does the returns paragraph explaining step_path. However, the :param list duplicates six parameters that the schema already documents at 100% coverage, and the inline-stage paragraph is longer than the actionable information it contains. Trimming the redundant parameter block would sharpen the definition considerably.

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 six-parameter destructive tool with no output schema, the description covers the mutation risk, the printer_id override of explicit dimensions, the return shape, and even the UI side effect of opening the 3D stage. An agent has everything needed to call it safely and set user expectations.

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 every parameter is already documented in structured form, including the 256.0 defaults and printer_id precedence. The description's :param block largely restates those same meanings and adds no new syntax or interaction detail, and it omits the default values that the schema carries. Baseline 3 is correct when the schema does the heavy lifting.

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 first sentence gives a precise verb and resource: 'Auto-scale a mesh to fit within a build volume while maintaining aspect ratio', and the follow-up clarifies the operation is a uniform shrink-to-largest-fitting-size. This is unambiguous on its own, but it never names the sibling that handles the non-scaling case (e.g. split_mesh_to_fit), so an agent must infer the boundary from the sibling name alone.

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?

'Useful when a model is too large for your printer' gives a concrete triggering condition, which is more than most tool descriptions offer. There is no explicit when-not guidance and no alternative named for the case where the user wants to split or reposition rather than scale, so the agent is left to infer those 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