generate_from_template
Build a print-ready STL from a parametric template using the user's exact dimensions, so functional parts like brackets, bins, or clips fit without writing OpenSCAD.
Instructions
Build a printable STL from a parametric part, to the user's dimensions.
This is how Kiln makes a FUNCTIONAL PART without writing any
OpenSCAD: pick a template, pass the dimensions the user gave you,
and get a print-ready STL. It runs LOCALLY through OpenSCAD — free,
no AI provider, no API key, and every template in the library is
print-verified at its default, minimum, and maximum parameters.
Reach for this the moment a user describes a functional part they
need in specific sizes ("a bracket for a 200 mm shelf", "a bin that
fits my 80 mm drawer", "a clip for an 8 mm cable"). Find the
template with ``find_design_templates(use_case)``, read its
parameters with ``get_design_template_info(id)`` or
``list_design_templates()``, then call this.
Only PARAMETRIC PARTS work here. The design PATTERNS returned by
``find_design_templates`` with ``generatable: false`` (snap fits,
living hinges, press fits) are guidance for OpenSCAD you write
yourself — this tool rejects them.
For AI-assisted parameter inference plus structural analysis, use
``smart_generate_from_template``.
When the kiln-pro package is installed (Pro+ tier), the result MAY
carry an ``intent`` block describing the geometric assertions the
template parameters implied, and a sidecar ``<mesh>.intent.json``
is written next to the produced STL. Free / public installs see
the result unchanged.
When you pass a parameter that sizes a hole for real hardware (a
screw or bolt hole, a bore, a dowel or pin hole, a magnet pocket),
the result carries a ``fastener_advice`` block saying the part was
built to your number and nothing sized it for a named fastener.
Kiln raises that once per session across every tool that can raise
it, so a later build may omit the block even though it qualifies.
Read its ``agent_instruction`` before repeating any of it to the user.
Args:
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.
template_id: Parametric part id, from ``find_design_templates``
or ``list_design_templates`` (e.g. ``"shelf_bracket"``).
parameters: Dict of parameter overrides carrying the user's own
dimensions (e.g. ``{"arm_length": 200, "thickness": 8}``).
Anything you leave out keeps the template's default.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": "generate_from_template"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| brief_id | No | 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: "". | |
| parameters | No | Dict of parameter overrides carrying the user's own dimensions (e.g. ``{"arm_length": 200, "thickness": 8}``). Anything you leave out keeps the template's default. | |
| template_id | Yes | Parametric part id, from ``find_design_templates`` or ``list_design_templates`` (e.g. ``"shelf_bracket"``). |