Skip to main content
Glama

iterate_design

Destructive

Generates a 3D model from a prompt or OpenSCAD code, validates printability, then improves and regenerates until it passes or hits the iteration limit, returning the best result.

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

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true, and openWorldHint=false, so the mutation profile is covered; the description goes further by disclosing the loop mechanics, the two stopping conditions (validation pass or max_iterations), and that the best result is returned with iteration history. It also reveals non-obvious side effects beyond the annotations: an inline 3D stage panel is opened on success, oversized meshes are silently decimated, and the best iteration is recorded against and checked against a saved goal including any reference picture. It stops short of mentioning cost, latency, or what 'destructive' concretely overwrites.

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 strongest content is front-loaded in the first sentence, but the body then duplicates the input schema line-for-line via RST :param: entries and appends two loosely related paragraphs (the 3D stage, the MAKE DOORS routing note). The stage paragraph carries real information; the param block and the rambling MAKE DOORS prose do not earn their space.

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, no-output-schema mutation tool this covers the essentials: the loop stages, termination conditions, the shape of the return value (best result plus iteration history), and notable side effects. Gaps are minor but real — nothing about failure modes when max_iterations is exhausted without passing validation, or about the cost/time of repeated generation.

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, and the description's :param: block is essentially a verbatim restatement of those same descriptions. The goal_id text adds the most meaning (recording the best iteration against the goal and the reference_check against a stored picture), but that too is already in the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening line gives a specific verb-and-resource summary ('Automated design iteration: generate -> validate -> improve -> regenerate') and the following sentence spells out the closed loop and its termination conditions, so an agent knows exactly what the tool does. What it lacks is clean differentiation from siblings: the MAKE DOORS paragraph says compile_scad 'IS the make → preview → iterate loop,' which muddies rather than sharpens the distinction from iterate_design itself.

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

Usage Guidelines2/5

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

Usage is implied by the loop narrative (use when you want validation plus automatic regeneration), and the stop conditions are stated, but there is no explicit 'use this instead of X when Y.' The only routing text present is actively confusing: it says design_session is not installed here and that compile_scad is the make/preview/iterate loop, leaving the agent unsure when iterate_design should ever be chosen over compile_scad.

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