Skip to main content
Glama

Sweep Tolerance Range

sweep_tolerance
Read-only

Use this when you need to check whether a mechanism stays buildable across a tolerance/dimension range, not just at one nominal value. Declares one or more param() names with a { values: [...] } list or a { min, max, steps } range, re-evaluates the script once per cartesian-product combination (capped at 64 combos — exceeding it truncates to the first 64 and emits kinematic.sweep-tolerance.combo-cap-exceeded), and runs the standard gates on each combo: interference, mounting-hole diameter agreement, and joint-axis binding (all three, default on); reachability only when gates.reachable names a tip_link + target. Returns the pass/fail envelope table (one row per combo) plus firstFailure per gate — the fastest way to find the first param value at which a design breaks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoInline kernelCAD script source.
fileNoPath to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.
gatesNoWhich standard gates to run per combo.
paramsYesparam() name -> { values: [number|string, ...] } or { min, max, steps }.
assemblyNoAssembly name; defaults to the first captured assembly.

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: -{
      -  "combosCapped": {
      -    "description": "True when the full cartesian product exceeded the 64-combo cap.",
      -    "type": "boolean"
      -  },
      -  "combosEvaluated": {
      -    "description": "Number of combos actually evaluated (capped at 64).",
      -    "type": "number"
      -  },
      -  "diagnostics": {
      -    "description": "Sweep-level diagnostics (e.g. combo-cap-exceeded).",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "type": "string"
      -  },
      -  "errorCode": {
      -    "type": "string"
      -  },
      -  "firstFailure": {
      -    "additionalProperties": true,
      -    "description": "First failing combo per gate name.",
      -    "type": "object"
      -  },
      -  "ok": {
      -    "description": "Whether every gate passed on every evaluated combo.",
      -    "type": "boolean"
      -  },
      -  "results": {
      -    "description": "One entry per evaluated combo: { combo, gates, diagnostics }.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed1 schema field changed
    • changedInput schema / properties / file / description
      Previous value: -"Path to a .kcad.ts script file."New value: +"Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
  3. Added

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.