Skip to main content
Glama

Sweep Tolerance Range

sweep_tolerance
Read-onlyIdempotent

Use this when you need to know where and why a design breaks across a tolerance/dimension range, not just whether it builds at one nominal value. Declares one or more param() names with a { values: [...] } list or a { min, max, steps } range (number params are bisected; choice/string params are evaluated as discrete points), 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 measures every requirement in the S2 ledger (script require(), dfmSpec, gated FEA, mechanical intent) plus 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. After the coarse grid it bisects each numeric pass/fail transition down to boundaryTolerance and reports the boundary value, the failing side, and the binding requirement/gate names (e.g. "wall fails below 1.840 mm; binding: wall"). Returns per-combo verdicts, firstFailure per gate, firstRequirementFailure per requirement, boundaries[], and a coverage statement that says "checked at N points plus boundaries", never "proven".

Input 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.
boundaryBudgetNoMaximum extra evaluations spent bisecting boundaries. Default 64; 0 skips bisection.
boundaryToleranceNoAbsolute parameter tolerance for boundary bisection. Default 0.001.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / boundaryBudget
      Added value: +{
      +  "description": "Maximum extra evaluations spent bisecting boundaries. Default 64; 0 skips bisection.",
      +  "type": "number"
      +}
    • addedInput schema / properties / boundaryTolerance
      Added value: +{
      +  "description": "Absolute parameter tolerance for boundary bisection. Default 0.001.",
      +  "type": "number"
      +}
  2. 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"
      -]
  3. 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."
  4. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: discloses the cartesian-product re-evaluation model, a hard 64-combo cap with truncation to the first 64 and a named diagnostic (kinematic.sweep-tolerance.combo-cap-exceeded), which gates default on, that reachability requires a tipLink + targetPosition, and that numeric transitions are bisected to boundaryTolerance. Consistent with readOnlyHint=true and destructiveHint=false — this is purely analytical and the description makes that explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the selecting condition, then behavior, then return shape — a sensible order with essentially no filler. It is a single dense run-on sentence chain, though every clause carries distinct information (cap, diagnostic code, bisection, gate defaults), so the length is earned rather than padded.

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

Completeness5/5

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

For a 7-parameter nested-schema tool with an output schema, the description covers the operational model, the caps and failure modes, gate defaults, and even the honesty caveat in the coverage statement ('checked at N points plus boundaries', never 'proven'). An agent has everything needed to call it correctly and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline would be 3, but the description adds real semantics: number params are bisected while choice/string params are evaluated as discrete points, the values-list vs min/max/steps forms, gates defaulting on, and reachability only firing when configured. It does not explain boundaryBudget vs boundaryTolerance tradeoffs beyond what the schema already says, keeping it out of the top band.

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 operation (sweep a tolerance/dimension range and locate where and why the design breaks) rather than a generic 'evaluate'. The opening clause 'not just whether it builds at one nominal value' implicitly contrasts it with the single-point evaluation tools in the sibling list (verify, evaluate_script). An agent can distinguish this from any sibling without opening a schema.

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

Usage Guidelines4/5

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

The 'Use this when you need to know where and why a design breaks across a tolerance/dimension range' clause gives a clear selecting condition, and 'not just whether it builds at one nominal value' draws the boundary against nominal single-point checks. It stops short of naming the alternative sibling tool explicitly, so the agent still has to infer which tool it is being contrasted with.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.