Skip to main content
Glama

smart_generate_from_template

Turn a parametric template into a print-ready STL by generating the mesh, analyzing structural risks, optionally adding reinforcements, and recommending slicer settings.

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 goal_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
goal_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. Changed2 schema fields changedv1.6.0
    • removedInput schema / properties / brief_id
      Removed value: -{
      -  "description": "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: \"\".",
      -  "title": "Brief Id",
      -  "type": "string"
      -}
    • addedInput schema / properties / goal_id
      Added value: +{
      +  "description": "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: \"\".",
      +  "title": "Goal Id",
      +  "type": "string"
      +}
  2. 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``."
  3. 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"
      +}
  4. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, destructiveHint=false, openWorldHint=false, and the description goes well beyond them: it discloses side effects (writes an STL, optionally mutates the model with reinforcements, opens an interactive 3D stage, auto-decimates oversized meshes) and names the return payload. It does not say where the STL is written or whether existing files are overwritten.

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?

Front-loaded with a one-line summary, then a scannable numbered pipeline — well organized and the ordering earns its space. However, the ':param:' block duplicates the schema verbatim and the 'MAKE DOORS' paragraph discusses design_session/compile_scad routing that is tangential to invoking this tool, adding length without invocation value.

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 tool with no output schema, the description supplies the essential missing piece — a summary of the returned dict (STL path, structural grade, reinforcements, print settings) — plus the pipeline's side effects and next steps. Remaining gaps (file destination, failure modes, timing) are minor for this tool class.

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 all six parameters; the ':param:' block in the description restates those descriptions nearly verbatim. The only marginal addition is explaining why 'material' and 'printer_id' matter (settings inference and reinforcement sizing), which is already implied by the schema text.

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 ('Generate from template') and immediately distinguishes itself from the sibling: 'Higher-level than generate_from_template — adds structural risk analysis and auto-reinforcement.' The numbered five-step breakdown makes the exact scope unambiguous, and the parenthetical '(recommended for functional parts)' adds targeting.

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 clear when-to-use ('recommended for functional parts') and names the exact downstream calls the output feeds into ('reslice_with_overrides' or 'run_reslice_and_print'), plus the upstream sources ('list_design_templates' for template_id). It does not give a crisp when-NOT-to-use rule beyond the implicit comparison to generate_from_template, so it falls short of a 5.

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