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.
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
okYesWhether every gate passed on every evaluated combo.
errorNo
resultsNoOne entry per evaluated combo: { combo, gates, diagnostics }.
errorCodeNo
diagnosticsNoSweep-level diagnostics (e.g. combo-cap-exceeded).
combosCappedNoTrue when the full cartesian product exceeded the 64-combo cap.
firstFailureNoFirst failing combo per gate name.
combosEvaluatedNoNumber of combos actually evaluated (capped at 64).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is known. The description adds substantial behavioral context beyond annotations: it explains the cartesian-product evaluation, the 64-combo cap with the emitted event name, the default-on gates, the reachability gate condition, and the return envelope with firstFailure. This is rich, non-obvious behavior that an agent needs to know.

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

Conciseness5/5

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

The description is dense but every sentence earns its place: usage trigger, param declaration syntax, combo cap behavior, gate defaults, reachability condition, and return value. It is front-loaded with the primary use case and then details. No filler or repetition of schema field names.

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?

Given the tool's complexity (5 params, nested gates object, output schema present), the description covers the essential behavioral contract: what triggers the tool, how params are specified, what gates run by default, the cap behavior, and what is returned. The output schema exists, so return values need not be fully re-explained. Nothing critical is missing for an agent to select and invoke this tool correctly.

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 description coverage is 100%, so the schema already documents all parameters. The description adds meaning by explaining how params are declared ({ values: [...] } or { min, max, steps }), how gates interact (all three default on, reachability only when gates.reachable names a tip_link + target), and what the output contains. This goes beyond the schema's terse field descriptions, though the schema already carries most of the load.

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 description states a specific verb ('check whether a mechanism stays buildable') and resource ('across a tolerance/dimension range'), and distinguishes it from a nominal single-value evaluation. It also names the sibling alternative implicitly by contrasting with 'not just at one nominal value' and by describing the sweep behavior, making the tool's purpose unmistakable.

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

Usage Guidelines5/5

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

The description explicitly says 'Use this when you need to check whether a mechanism stays buildable across a tolerance/dimension range, not just at one nominal value.' This gives a clear when-to-use condition. It also explains the combo cap and the gate behavior, which helps an agent decide when this tool is appropriate versus alternatives like evaluate_script or design_loop.

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.