Skip to main content
Glama

iterate_design

Destructive

Generate, validate, and automatically refine a 3D model until it passes printability checks or reaches the iteration limit; returns the best result for printing.

Instructions

Automated design iteration: generate -> validate -> improve -> regenerate.

        Runs a closed loop that generates a model, validates it for
        printability issues, and if issues are found, improves the prompt
        and regenerates.  Stops when the model passes validation or
        max_iterations is reached.  Returns the best result.

        :param prompt: Text description or OpenSCAD code.
        :param provider: Generation provider (default ``"openscad"``).
        :param max_iterations: Maximum improvement attempts (1-5).
        :param material: Optional material for design intelligence.
        :param printer_model: Optional printer model for constraints.
        :param brief_id: The saved goal's id from ``design_session``, so
            the best iteration is recorded against the goal and checked
            against it, including against any picture kept on the goal
            (``reference_check``).  Empty when there is no goal.
        :returns: Dict with the best result and iteration history.

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": {
      "prompt": "<prompt>"
    },
    "name": "iterate_design"
  }
}

Input Schema

NameRequiredDescriptionDefault
promptYesText description or OpenSCAD code.
brief_idNoThe saved goal's id from ``design_session``, so the best iteration is recorded against the goal and checked against it, including against any picture kept on the goal (``reference_check``). Empty when there is no goal. Default: "".
materialNoOptional material for design intelligence. Default: "".
providerNoGeneration provider (default ``"openscad"``). Default: "openscad".
printer_modelNoOptional printer model for constraints. Default: "".
max_iterationsNoMaximum improvement attempts (1-5). Default: 3.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 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 the best iteration is recorded against the goal and checked against it, including against any picture kept on the goal (``reference_check``).  Empty when there is no goal. Default: \"\"."
    • changedInput schema / properties / material / description
      Previous value: -"Default: \"\"."New value: +"Optional material for design intelligence. Default: \"\"."
    • changedInput schema / properties / max_iterations / description
      Previous value: -"Default: 3."New value: +"Maximum improvement attempts (1-5). Default: 3."
    • changedInput schema / properties / printer_model / description
      Previous value: -"Default: \"\"."New value: +"Optional printer model for constraints. Default: \"\"."
    • addedInput schema / properties / prompt / description
      Added value: +"Text description or OpenSCAD code."
    • changedInput schema / properties / provider / description
      Previous value: -"Default: \"openscad\"."New value: +"Generation provider (default ``\"openscad\"``). Default: \"openscad\"."
  2. Changed10 schema fields changedv1.5.0
    • removedInput schema / properties / brief_id / default
      Removed value: -""
    • addedInput schema / properties / brief_id / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / material / default
      Removed value: -""
    • addedInput schema / properties / material / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / max_iterations / default
      Removed value: -3
    • addedInput schema / properties / max_iterations / description
      Added value: +"Default: 3."
    • removedInput schema / properties / printer_model / default
      Removed value: -""
    • addedInput schema / properties / printer_model / description
      Added value: +"Default: \"\"."
    • removedInput schema / properties / provider / default
      Removed value: -"openscad"
    • addedInput schema / properties / provider / description
      Added value: +"Default: \"openscad\"."
  3. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

The description adds real behavioral context the annotations do not: the closed-loop mechanics, that it stops on validation success or max_iterations, that it returns the best result, and that brief_id ties results to a saved goal with reference_check. However, annotations flag destructiveHint=true and the description never explains what gets overwritten by repeated generation, nor what an 'improvement attempt' consumes.

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 core docstring is front-loaded and efficient, but the appended INLINE 3D STAGE and MAKE DOORS paragraphs are long, promotional in tone, and mostly about host UI and sibling availability rather than this tool. They dilute the call-relevant content and push practical details behind tangential prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 6 parameters, no output schema, and a destructive mutation, the description covers the return shape ('best result and iteration history') and the UI side effect, which is helpful. It still fails to cover the destructive consequences flagged in annotations or what provider alternatives exist, leaving a meaningful gap for a write tool.

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 baseline is 3. The :param block largely restates the schema verbatim (including the identical brief_id wording) and adds no new meaning such as valid provider values or how max_iterations interacts with validation failure.

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 opening line states a specific verb and process: 'Automated design iteration: generate -> validate -> improve -> regenerate,' then defines the loop's termination conditions. A named sibling (compile_scad) and design_session are referenced, so an agent can distinguish this from plain generation or compile tools.

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

Usage Guidelines3/5

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

The MAKE DOORS section implies iterate_design is the loop when design_session is unavailable and points at compile_scad as the on-install make→preview→iterate path, but never states plainly when to pick iterate_design over compile_scad or tweak_and_compile_scad. The guidance is implied rather than decided, leaving the agent to infer.

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