generate_model_with_provider
Turns a natural-language brief into a printable 3D model via a configured cloud provider, audits the result for printability, and retries with corrections automatically.
Instructions
Generate a printable design via an external AI provider.
The cloud, provider-backed creation path: hands a natural-language
description to an external idea-to-3D service, audits the candidate
for printability and design correctness, and can perform one or
more corrective retries using feedback from failed attempts.
This is NOT the default. It needs a configured provider (the user
supplies their own API key). For most custom objects the free,
keyless path is to author the OpenSCAD yourself and make it with
``design_session(verb="generate", goal_id=..., scad_code=...)`` —
or ``compile_scad`` on an install without ``design_session`` — no
provider required. Reach for this tool when the shape is organic
or photo-derived and hard to express in OpenSCAD AND a provider is
configured.
For the user-facing saved-goal flow (capturing duty / environment /
materials / safety so the audit and post-print review can verify
the result against the user's intent), call this through
``design_session(verb="generate", goal_id=...)`` rather than
calling ``generate_model_with_provider`` directly.
Provider notes:
- ``auto`` prefers Gemini for idea-to-CAD when available.
- ``openscad`` is intentionally rejected here because it compiles
code; it does not turn a natural-language idea into geometry.
No-provider fallback:
- If no cloud provider is configured this raises NO_PROVIDER. Do
NOT ask the user to set an API key — fall back to writing the
OpenSCAD yourself and making it through design_session (or
compile_scad where design_session is not installed). That free,
local path is the default for custom objects; cloud providers are
an opt-in the user supplies their own key for (best for organic
or photo-based shapes OpenSCAD can't easily reach).
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.
requirements: Natural-language description of the part to create.
provider: ``auto``, ``gemini``, ``meshy``, ``tripo3d``, or ``stability``.
material: Optional material target (e.g. ``"petg"``).
printer_model: Optional printer model ID (e.g. ``"bambu_a1"``).
style: Optional style hint for providers that support it.
output_dir: Optional directory for generated files.
build_volume_x: Build volume X in mm. Used only when X, Y and
Z are all given; otherwise ``printer_model`` supplies the bed.
build_volume_y: Build volume Y in mm. Used only when X, Y and
Z are all given; otherwise ``printer_model`` supplies the bed.
build_volume_z: Build volume Z in mm. Used only when X, Y and
Z are all given; otherwise ``printer_model`` supplies the bed.
nozzle_diameter: Printer nozzle diameter in mm.
layer_height: Printer layer height in mm.
max_overhang_angle: Supportless overhang threshold in degrees.
timeout: Max seconds to wait per generation attempt.
max_attempts: Max corrective generation attempts.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": {
"requirements": "<requirements>"
},
"name": "generate_model_with_provider"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| style | No | Optional style hint for providers that support it. | |
| timeout | No | Max seconds to wait per generation attempt. Default: 600. | |
| 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: "". | |
| material | No | Optional material target (e.g. ``"petg"``). | |
| provider | No | ``auto``, ``gemini``, ``meshy``, ``tripo3d``, or ``stability``. Default: "auto". | |
| output_dir | No | Optional directory for generated files. | |
| layer_height | No | Printer layer height in mm. Default: 0.2. | |
| max_attempts | No | Max corrective generation attempts. Default: 2. | |
| requirements | Yes | Natural-language description of the part to create. | |
| printer_model | No | Optional printer model ID (e.g. ``"bambu_a1"``). | |
| build_volume_x | No | Build volume X in mm. Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed. | |
| build_volume_y | No | Build volume Y in mm. Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed. | |
| build_volume_z | No | Build volume Z in mm. Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed. | |
| nozzle_diameter | No | Printer nozzle diameter in mm. | |
| max_overhang_angle | No | Supportless overhang threshold in degrees. Default: 45.0. |