Skip to main content
Glama

Run Design Loop

design_loop

Use this when the goal is complex / production / enclosure / gearbox / robot-arm / multi-body, or when you need evaluate→review/verify→revise until green. PREFERRED over one-shot evaluate_script+open_in_studio for Adam-level parts. Runs a CAD design loop over attempt scripts: review_cad each attempt, continue past functional attempts with unresolved warnings, return repair prompts (nextActionPrompt) plus structured revisionAssist (suggestedPatches / autoApplied.suggestedCode for repairable feature failures; cookbook steers for stacked-primitive toys). Stop on ok or convergence.escalate. To pick among N alternative candidates for one goal without a judge, pass them all as attempts with consensus:true (geometric medoid selection). For organic/car bodies set likenessProfile:"automotive" and pass bodyLikeness (or automotive stills on visualReview.checks) — attempts fail closed until body-likeness is publishReady. Optionally write a Studio build record JSON.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalYesOriginal user design goal. Fed into every review_cad repair prompt.
assemblyNo
attemptsYesOrdered design attempts. Each item is { id?, title?, file? OR code?, visualReview? } — provide file or code (at least one). File attempts can be replayed by Studio build records.
consensusNoBest-of-N by geometric consensus. When true, attempts are N independent candidates for the SAME goal (not a repair sequence): all are reviewed (stopOnPass ignored), all scripts are executed, candidates without a valid solid are dropped, and the candidate whose geometry agrees most with the others (medoid by symmetric Chamfer distance, same model frame) is selected. Ties go to more gates passed, then the shorter script. Returns consensus { chosenIndex, chosenAttemptId, scores, distances, reason }; ok / finalAttemptId / nextActionPrompt describe the selected candidate. Default false.
autoReviseNoWhen true (default), failing attempts with repairable feature diagnostics (boolean miss, oversized fillet, …) run bounded repair_script and attach revisionAssist.suggestedPatches / autoApplied.suggestedCode. Set false to skip the extra repair pass (hints-only). Does not autonomously rewrite full CAD models.
epsilonMm3NoForwarded to review_cad.
stopOnPassNoStop after the first attempt that is functional and passes the quality gate. Default true.
recordTitleNoOptional title for the build record.
bodyLikenessNoWhen likenessProfile=automotive: body_bbox (required for gate), wheels, cabin_bbox, still_verdicts. Missing body_bbox fails with reference.likeness.gate-required. Stills may also come from visualReview.checks.
combinatorialNoSample all 2^N limit-corner combinations across mates with declared limits. Capped at 8 mates with limits; combine with samplesPerMate for both interior coverage and worst-pose detection. Default false.
samplesPerMateNoPose-envelope samples per declared-limit mate. 1 (default) = corners only; >=3 adds uniform interior points between min and max. Total samples per non-locked mate = samplesPerMate.
gripperApertureNoOptional gripper aperture request forwarded to review_cad.
likenessProfileNoWhen 'automotive', require organic-body still checks on visualReview AND the body-likeness publish gate (pass bodyLikeness or stills on checks). Attempts stay non-ok until publishReady. Final open_in_studio must pass likeness_profile:'automotive' (server hard-gates success).
trackConnectorsNoConnector refs to track across sampled poses.
outputRecordPathNoOptional JSON path to write a Studio-compatible build record.
preserveInterfacesNoExternal mates, connector refs, part names, or behavioral interfaces the agent must preserve between attempts.
allowReviewWarningsNoWarning diagnostic codes the original prompt explicitly allows. Other review warnings keep the loop iterating even if review_cad is functionally ok.
includeInterferenceNoForwarded to review_cad. Default true.
includePoseEnvelopeNoForwarded to review_cad. Default true.
requireVisualReviewNoRequire screenshot-backed visualReview with structured checks before accepting an attempt. Default true; set false only for explicit non-visual batch checks.
requirePhysicalAcceptanceNoRequire declared physicalUseCase common-pose reachability and pose-bound quasi-static certification before accepting an attempt. Design-loop also enables this automatically when an attempt script calls physicalUseCase(...).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "attempts": {
      -    "description": "Per-attempt review results (includes revisionAssist when failed).",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "convergence": {
      -    "additionalProperties": true,
      -    "description": "Present when trailing failures share a signature (escalate).",
      -    "type": "object"
      -  },
      -  "finalAttemptId": {
      -    "type": "string"
      -  },
      -  "goal": {
      -    "description": "Echoed design goal.",
      -    "type": "string"
      -  },
      -  "nextActionPrompt": {
      -    "type": "string"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  },
      -  "outputRecordPath": {
      -    "type": "string"
      -  },
      -  "record": {
      -    "additionalProperties": true,
      -    "description": "Studio-compatible build record (when requested).",
      -    "type": "object"
      -  },
      -  "recordUrl": {
      -    "type": "string"
      -  },
      -  "revisionAssist": {
      -    "additionalProperties": true,
      -    "description": "Structured revision assist from the last failing attempt: hints, suggestedPatches (AST diffs), optional autoApplied.suggestedCode when repair_script cleared a repairable diagnostic. Honest scope — not full autonomous CAD rewrite.",
      -    "type": "object"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok",
      -  "goal",
      -  "attempts"
      -]
  2. Changed1 schema field changed
    • addedInput schema / properties / consensus
      Added value: +{
      +  "description": "Best-of-N by geometric consensus. When true, attempts are N independent candidates for the SAME goal (not a repair sequence): all are reviewed (stopOnPass ignored), all scripts are executed, candidates without a valid solid are dropped, and the candidate whose geometry agrees most with the others (medoid by symmetric Chamfer distance, same model frame) is selected. Ties go to more gates passed, then the shorter script. Returns consensus { chosenIndex, chosenAttemptId, scores, distances, reason }; ok / finalAttemptId / nextActionPrompt describe the selected candidate. Default false.",
      +  "type": "boolean"
      +}
  3. Changed4 schema fields changed
    • addedInput schema / properties / autoRevise
      Added value: +{
      +  "description": "When true (default), failing attempts with repairable feature diagnostics (boolean miss, oversized fillet, …) run bounded repair_script and attach revisionAssist.suggestedPatches / autoApplied.suggestedCode. Set false to skip the extra repair pass (hints-only). Does not autonomously rewrite full CAD models.",
      +  "type": "boolean"
      +}
    • changedOutput schema / properties / attempts / description
      Previous value: -"Per-attempt review results."New value: +"Per-attempt review results (includes revisionAssist when failed)."
    • addedOutput schema / properties / convergence
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Present when trailing failures share a signature (escalate).",
      +  "type": "object"
      +}
    • addedOutput schema / properties / revisionAssist
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Structured revision assist from the last failing attempt: hints, suggestedPatches (AST diffs), optional autoApplied.suggestedCode when repair_script cleared a repairable diagnostic. Honest scope — not full autonomous CAD rewrite.",
      +  "type": "object"
      +}
  4. Changed2 schema fields changed
    • addedInput schema / properties / bodyLikeness
      Added value: +{
      +  "description": "When likenessProfile=automotive: body_bbox (required for gate), wheels, cabin_bbox, still_verdicts. Missing body_bbox fails with reference.likeness.gate-required. Stills may also come from visualReview.checks.",
      +  "properties": {
      +    "body_bbox": {
      +      "type": "object"
      +    },
      +    "cabin_bbox": {
      +      "type": "object"
      +    },
      +    "length_axis": {
      +      "enum": [
      +        "x",
      +        "y"
      +      ],
      +      "type": "string"
      +    },
      +    "require_stills": {
      +      "type": "boolean"
      +    },
      +    "still_verdicts": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "wheels": {
      +      "items": {
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
    • changedInput schema / properties / likenessProfile / description
      Previous value: -"When 'automotive', also require organic-body still checks: side-body-over-wheels, side-cabin-aft, rear-haunch, ortho-proportions-vs-reference. Pair with verify({ check: 'body-likeness' }) before open_in_studio."New value: +"When 'automotive', require organic-body still checks on visualReview AND the body-likeness publish gate (pass bodyLikeness or stills on checks). Attempts stay non-ok until publishReady. Final open_in_studio must pass likeness_profile:'automotive' (server hard-gates success)."
  5. Changed1 schema field changed
    • addedInput schema / properties / likenessProfile
      Added value: +{
      +  "description": "When 'automotive', also require organic-body still checks: side-body-over-wheels, side-cabin-aft, rear-haunch, ortho-proportions-vs-reference. Pair with verify({ check: 'body-likeness' }) before open_in_studio.",
      +  "enum": [
      +    "automotive"
      +  ],
      +  "type": "string"
      +}
  6. Changed1 schema field changed
    • addedInput schema / properties / requirePhysicalAcceptance
      Added value: +{
      +  "description": "Require declared physicalUseCase common-pose reachability and pose-bound quasi-static certification before accepting an attempt. Design-loop also enables this automatically when an attempt script calls physicalUseCase(...).",
      +  "type": "boolean"
      +}
  7. Changed5 schema fields changed
    • changedInput schema / properties / attempts / description
      Previous value: -"Ordered design attempts. Each item is { id?, title?, file? or code?, visualReview? }. File attempts can be replayed by Studio build records."New value: +"Ordered design attempts. Each item is { id?, title?, file? OR code?, visualReview? } — provide file or code (at least one). File attempts can be replayed by Studio build records."
    • addedInput schema / properties / attempts / items / anyOf
      Added value: +[
      +  {
      +    "required": [
      +      "file"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "code"
      +    ]
      +  }
      +]
    • addedInput schema / properties / attempts / items / properties / code / description
      Added value: +"Inline kernelCAD script source. Provide file or code."
    • addedInput schema / properties / attempts / items / properties / file / description
      Added value: +"Path to a .kcad.ts script on disk. Provide file or code."
    • changedInput schema / properties / attempts / items / properties / visualReview / description
      Previous value: -"Evidence from the reviewing agent after rendering/opening screenshots. Accepted reviews must include screenshotPath, concrete findings, and all required checks passing."New value: +"Optional. Evidence from the reviewing agent after rendering/opening screenshots. Accepted reviews must include screenshotPath, concrete findings, and all required checks passing."
  8. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "attempts": {
      +      "description": "Per-attempt review results.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "finalAttemptId": {
      +      "type": "string"
      +    },
      +    "goal": {
      +      "description": "Echoed design goal.",
      +      "type": "string"
      +    },
      +    "nextActionPrompt": {
      +      "type": "string"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    },
      +    "outputRecordPath": {
      +      "type": "string"
      +    },
      +    "record": {
      +      "additionalProperties": true,
      +      "description": "Studio-compatible build record (when requested).",
      +      "type": "object"
      +    },
      +    "recordUrl": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "ok",
      +    "goal",
      +    "attempts"
      +  ],
      +  "type": "object"
      +}
  9. Changed1 schema field changed
    • changedInput schema / properties / attempts / items / properties / visualReview / properties / checks / description
      Previous value: -"Required checklist entries: main-object-count, proportions-match-reference, required-visible-features, no-stray-or-floating-geometry, canonical-views-physically-coherent."New value: +"Required checklist entries: main-object-count, proportions-match-reference, required-visible-features, no-stray-or-floating-geometry, attachment-plausibility, semantic-orientation-alignment, device-depth-and-construction, canonical-views-physically-coherent."
  10. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.