Skip to main content
Glama

smart_generate_from_template

Generate a print-ready STL from a parametric template, analyze structural risks, auto-apply reinforcements, and infer slicer settings for functional 3D parts.

Instructions

Generate from template + structural analysis + print settings (recommended for functional parts).

        Higher-level than ``generate_from_template`` — adds structural risk analysis
        and auto-reinforcement. This is the **one-step design-to-print-ready** pipeline:

        1. Generates STL from a parametric template (like ``generate_from_template``)
        2. Runs structural risk analysis (thin necks, cantilevers, sharp corners)
        3. Optionally auto-applies reinforcements (fillets, wall thickening, etc.)
        4. Infers optimal slicer settings tuned to the design's structural profile
        5. Returns the STL path + recommended settings ready for slicing

        The agent can take the output and directly call ``reslice_with_overrides``
        or ``run_reslice_and_print`` with the recommended settings.

        :param brief_id: The saved goal's id from ``design_session``, so this make
            is recorded against the goal and checked against it. Empty when
            there is no goal.
        :param template_id: Template ID from ``list_design_templates``.
        :param parameters: Parameter overrides (e.g., ``{"phone_width": 80}``).
        :param material: Filament type for settings inference and for the
            reinforcements (PLA, PETG, ABS, etc.).
        :param auto_reinforce: If True, auto-apply structural reinforcements.
        :param printer_id: The printer the part is for, so the reinforcements
            are sized for its nozzle and layer height.
        :returns: Dict with STL path, structural grade, reinforcements, and print settings.

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.

MAKE DOORS: design_session, Kiln's front door for making an object, is not installed here (signed in to Kiln it runs on Kiln's servers). On this install compile_scad IS the make → preview → iterate loop: make it, show the preview, iterate.

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": {
      "template_id": "<template_id>"
    },
    "name": "smart_generate_from_template"
  }
}

Input Schema

NameRequiredDescriptionDefault
brief_idNoThe saved goal's id from ``design_session``, so this make is recorded against the goal and checked against it. Empty when there is no goal. Default: "".
materialNoFilament type for settings inference and for the reinforcements (PLA, PETG, ABS, etc.). Default: "PLA".
parametersNoParameter overrides (e.g., ``{"phone_width": 80}``).
printer_idNoThe printer the part is for, so the reinforcements are sized for its nozzle and layer height.
template_idYesTemplate ID from ``list_design_templates``.
auto_reinforceNoIf True, auto-apply structural reinforcements. Default: false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.5.1
    • changedInput schema / properties / auto_reinforce / description
      Previous value: -"Default: false."New value: +"If True, auto-apply structural reinforcements. Default: false."
    • changedInput schema / properties / brief_id / description
      Previous value: -"Default: \"\"."New value: +"The saved goal's id from ``design_session``, so this make is recorded against the goal and checked against it. Empty when there is no goal. Default: \"\"."
    • changedInput schema / properties / material / description
      Previous value: -"Default: \"PLA\"."New value: +"Filament type for settings inference and for the reinforcements (PLA, PETG, ABS, etc.). Default: \"PLA\"."
    • addedInput schema / properties / parameters / description
      Added value: +"Parameter overrides (e.g., ``{\"phone_width\": 80}``)."
    • addedInput schema / properties / printer_id / description
      Added value: +"The printer the part is for, so the reinforcements are sized for its nozzle and layer height."
    • addedInput schema / properties / template_id / description
      Added value: +"Template ID from ``list_design_templates``."
  2. Changed7 schema fields changedv1.5.0
    • removedInput schema / properties / auto_reinforce / default
      Removed value: -false
    • addedInput schema / properties / auto_reinforce / description
      Added value: +"Default: false."
    • addedInput schema / properties / brief_id
      Added value: +{
      +  "description": "Default: \"\".",
      +  "title": "Brief Id",
      +  "type": "string"
      +}
    • removedInput schema / properties / material / default
      Removed value: -"PLA"
    • addedInput schema / properties / material / description
      Added value: +"Default: \"PLA\"."
    • removedInput schema / properties / parameters / default
      Removed value: -null
    • addedInput schema / properties / printer_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "title": "Printer Id"
      +}
  3. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare it is a non-destructive, closed-world write tool, so the safety profile is covered. The description adds genuinely useful behavior beyond that: auto-reinforcement is optional, settings are inferred from the design's structural profile, oversized meshes are decimated for the 3D stage, and a `brief_id` records the make against a goal. It stops short of describing failure modes or what happens when template parameters are invalid.

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 numbered pipeline is well front-loaded and easy to scan, but the `:param:` and `:returns:` block duplicates schema text that is already fully covered, and the appended 3D-stage and 'MAKE DOORS' paragraphs are verbose and partly off-topic. Several sentences do not earn their place given the structured fields already present.

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 six-parameter, multi-stage pipeline tool with no output schema, the description is largely self-sufficient: it explains each stage, the return dict contents, and how to hand the result to slicing tools. The main residual gap is the absence of explicit error or fallback behavior when structural analysis or reinforcement fails.

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 coverage is 100%, so all six parameters are already documented in structured form. The description largely restates those same parameter definitions in RST style, adding only modest extra meaning such as printer-dependent reinforcement sizing. Baseline 3 is appropriate 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.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource (generates an STL from a parametric template) and enumerates the full pipeline: generation, structural risk analysis, optional reinforcement, setting inference, and return. It explicitly positions itself as the higher-level alternative to `generate_from_template`, so an agent can distinguish it from that sibling without opening either schema.

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?

It gives a clear suitability signal ('recommended for functional parts') and names the downstream tools to call with the output (`reslice_with_overrides`, `run_reslice_and_print`). It does not explicitly state when to prefer the simpler `generate_from_template` instead, leaving that inference to the agent, and the appended 'MAKE DOORS' note points toward `compile_scad` as the make loop, which muddies rather than sharpens the routing guidance.

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