Skip to main content
Glama

generate_model_with_provider

Destructive

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

NameRequiredDescriptionDefault
styleNoOptional style hint for providers that support it.
timeoutNoMax seconds to wait per generation attempt. Default: 600.
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: "".
materialNoOptional material target (e.g. ``"petg"``).
providerNo``auto``, ``gemini``, ``meshy``, ``tripo3d``, or ``stability``. Default: "auto".
output_dirNoOptional directory for generated files.
layer_heightNoPrinter layer height in mm. Default: 0.2.
max_attemptsNoMax corrective generation attempts. Default: 2.
requirementsYesNatural-language description of the part to create.
printer_modelNoOptional printer model ID (e.g. ``"bambu_a1"``).
build_volume_xNoBuild volume X in mm. Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed.
build_volume_yNoBuild volume Y in mm. Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed.
build_volume_zNoBuild volume Z in mm. Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed.
nozzle_diameterNoPrinter nozzle diameter in mm.
max_overhang_angleNoSupportless overhang threshold in degrees. Default: 45.0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed15 schema fields changedv1.5.1
    • 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: \"\"."
    • addedInput schema / properties / build_volume_x / description
      Added value: +"Build volume X in mm.  Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed."
    • addedInput schema / properties / build_volume_y / description
      Added value: +"Build volume Y in mm.  Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed."
    • addedInput schema / properties / build_volume_z / description
      Added value: +"Build volume Z in mm.  Used only when X, Y and Z are all given; otherwise ``printer_model`` supplies the bed."
    • changedInput schema / properties / layer_height / description
      Previous value: -"Default: 0.2."New value: +"Printer layer height in mm. Default: 0.2."
    • addedInput schema / properties / material / description
      Added value: +"Optional material target (e.g. ``\"petg\"``)."
    • changedInput schema / properties / max_attempts / description
      Previous value: -"Default: 2."New value: +"Max corrective generation attempts. Default: 2."
    • changedInput schema / properties / max_overhang_angle / description
      Previous value: -"Default: 45.0."New value: +"Supportless overhang threshold in degrees. Default: 45.0."
    • addedInput schema / properties / nozzle_diameter / description
      Added value: +"Printer nozzle diameter in mm."
    • addedInput schema / properties / output_dir / description
      Added value: +"Optional directory for generated files."
    • addedInput schema / properties / printer_model / description
      Added value: +"Optional printer model ID (e.g. ``\"bambu_a1\"``)."
    • changedInput schema / properties / provider / description
      Previous value: -"Default: \"auto\"."New value: +"``auto``, ``gemini``, ``meshy``, ``tripo3d``, or ``stability``. Default: \"auto\"."
    • addedInput schema / properties / requirements / description
      Added value: +"Natural-language description of the part to create."
    • addedInput schema / properties / style / description
      Added value: +"Optional style hint for providers that support it."
    • changedInput schema / properties / timeout / description
      Previous value: -"Default: 600."New value: +"Max seconds to wait per generation attempt. Default: 600."
  2. Changed21 schema fields changedv1.5.0
    • addedInput schema / properties / brief_id
      Added value: +{
      +  "description": "Default: \"\".",
      +  "title": "Brief Id",
      +  "type": "string"
      +}
    • removedInput schema / properties / build_volume_x / default
      Removed value: -null
    • removedInput schema / properties / build_volume_y / default
      Removed value: -null
    • removedInput schema / properties / build_volume_z / default
      Removed value: -null
    • removedInput schema / properties / layer_height / default
      Removed value: -0.2
    • addedInput schema / properties / layer_height / description
      Added value: +"Default: 0.2."
    • removedInput schema / properties / material / default
      Removed value: -null
    • removedInput schema / properties / max_attempts / default
      Removed value: -2
    • addedInput schema / properties / max_attempts / description
      Added value: +"Default: 2."
    • removedInput schema / properties / max_overhang_angle / default
      Removed value: -45
    • addedInput schema / properties / max_overhang_angle / description
      Added value: +"Default: 45.0."
    • addedInput schema / properties / nozzle_diameter / anyOf
      Added value: +[
      +  {
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / nozzle_diameter / default
      Removed value: -0.4
    • removedInput schema / properties / nozzle_diameter / type
      Removed value: -"number"
    • removedInput schema / properties / output_dir / default
      Removed value: -null
    • removedInput schema / properties / printer_model / default
      Removed value: -null
    • removedInput schema / properties / provider / default
      Removed value: -"auto"
    • addedInput schema / properties / provider / description
      Added value: +"Default: \"auto\"."
    • removedInput schema / properties / style / default
      Removed value: -null
    • removedInput schema / properties / timeout / default
      Removed value: -600
    • addedInput schema / properties / timeout / description
      Added value: +"Default: 600."
  3. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the destructiveHint=true annotation, the description discloses failure behavior (raises NO_PROVIDER and explicitly instructs not to ask for an API key), retry semantics (corrective attempts using failed-attempt feedback), provider-selection quirks (auto prefers Gemini; openscad rejected), and the inline 3D stage outcome. It does not explain what happens to files in output_dir or whether a previously generated file is overwritten, which is the main remaining gap for a destructive write tool.

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 purpose and the critical 'not the default' warning are front-loaded, which is good. However the no-provider fallback is explained twice (the NO_PROVIDER section and the MAKE DOORS note), and the Args list duplicates schema descriptions, adding length without new information.

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 complex 15-parameter generation tool with no output schema, the description covers routing, prerequisites, error handling, retry behavior, and the success experience (interactive stage). It is close to complete; the only omissions are return-file details and overwrite semantics for output_dir.

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 the schema already documents all 15 parameters, and the Args block largely repeats those descriptions verbatim. The only added meaning beyond the schema is the provider notes (auto→Gemini, openscad rejected), which is useful but marginal against a fully documented schema.

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 a printable design via an external AI provider' — then clarifies the mechanism (hands NL description to an idea-to-3D service, audits, retries). It explicitly distinguishes itself from the sibling paths design_session(verb="generate") and compile_scad, so an agent can pick it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use ('organic or photo-derived shapes hard to express in OpenSCAD AND a provider is configured') and when-not ('this is NOT the default,' free keyless path preferred). It names the alternative tools to route to and even the goal-flow wrapper to prefer over calling this directly.

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