Verify Design
verifyUse this when you need to check a design against a rule set. One verifier, selected by check:
'assembly' — static assembly review ({ file | code }, or the session evaluate_script left): mate validator, default-pose interference, joint topology, mechanical plausibility. ok:false with
blocking[]exactly when review_cad's blocking rules fire on these findings; review_cad also sweeps joint ranges and runs physics.'urdf' — structural validity of a .urdf file ({ urdf_path }).
'dfm' — print-readiness gates declared by dfmSpec() ({ file | code }).
'dfm-preflight' — sheet-metal flat pattern vs a job-shop's ordering rules ({ vendor, material, thickness_in|thickness_mm, ... }). Returns the vendor's catalog source pages as
sources; whendisclosureis present, show it with those links.'assembly-path' — continuous straight-line removal of each assembly part along ±X/±Y/±Z and optional world-space directions. Returns valid directions, blocking parts and one of three states (removable / blocked / unknown); sequence peels the directional blocking graph and reverses it into a build sequence with a model stamp. Fastened-mate and fixed-connect clusters become subassemblies: each is planned recursively inside and installed as one unit at the top level (
Step.subassembly). Remaining valid orders use deterministic heuristics (subassemblies first, outside-in, fewest reorientations, fewest tool changes); stuck sets get a budgeted blocking-reduction partition and a sampling fallback whose paths are labelled found-by-search, never proven. A fastener with a fastened-matefastenerdeclaration (axis, pitch, optional tool envelope) is tested along its helical path and reportedmotion: helical; a press/snapfitdeclaration becomes arequires-forcestep, never simulated. A modelled driver/socket/hex-key envelope swept along the approach axis addstoolBlocked{ fastener, blockers } and a failing S2 ledger entry; unmodelled tools add nothing. Threaded fasteners without metadata stay unknown: non-straight-path.stability: trueadds an approximate P3 support check at each build step: each part's mesh centre of mass must project inside the support polygon of its contacts with already-stable parts (declared or inferred base/fixture undergravity, default [0,0,-1]); unsupported parts becomeneedsHold{ part, reason, supports } and their steps carrystability: 'needs-hold', while stable steps may carryheldBy. This is a projection, not gravity simulation, friction, tipping or fixture analysis. disassemblyOrder runs a deterministic greedy removal pass. Watertight mesh approximation, conservative contact, no rotation/mate/hardware certification.'swept-collision' — sweep declared joint range(s) and report colliding poses.
'joint-range' — suggest revolute and prismatic mate limits from geometry. Each joint is swept alone from its authored pose, other mates held at their authored poses, until a non-exempt pair is within clearance_mm (default 0.3) or the finite search bound is reached. Exact BREP distance brackets the crossing and the reported stop is the clear side of that bracket, so the suggested limit keeps the requested clearance. Returns lower/upper stop, the limiting part pair, resolution, and status stop | no-stop | unknown. no-stop means no crossing was found at the sampled poses, not continuous proof that the interval is clear. Unknown (no finite bound, budget, or a failed measurement) is never reported as no-stop. The result includes a limits snippet to apply explicitly; the script is not rewritten. Mate neighbours and declared contact pairs are not stops.
'reachable' — inverse-kinematics reachability for an end-effector ({ tip_link, target_position, ... }).
'geometry-quality' — one solid body's BREP tiny faces and short edges (ids, locations, mm²/mm), plus sampled mirror symmetry about centroid XY/YZ/XZ and principal inertia planes ({ file | code, feature_id?, tiny_face_area_mm2?, tiny_face_relative?, short_edge_length_mm?, symmetry_tolerance_mm?, mesh_deflection_mm?, asserted_plane?: { origin, normal } }). Relative area is a fraction of total surface area; thresholds are ORed. Candidate planes are discovery; only an asserted plane gates symmetry. Approximate sampled tessellation, not exact BREP proof.
'fastener-installation' — measured explicit catalog-screw installation stations on lowered assembly BREP ({ file | code, fasteners:[{ part, against, engagement_part?, min_engagement_mm?, max_protrusion_mm? }], tolerance_mm?, angle_tolerance_deg? }). Reports annular bearing gap, bore axis/diameter/overlap and receiver geometric engagement/protrusion. Unknown or zero coverage cannot pass. Simplified threads do not certify torque, preload or strength.
'mounting-holes' — fastened mates: hole pairs one screw can use (equal, or clearance over a tap drill / hole({ thread }) of the same metric size; hole-free faces are a rigid bond) and fastener holes meeting at the contact face are coaxial. Sides it cannot resolve are info, never mismatches.
'load-capacity' — will it hold? Closed-form Euler-Bernoulli beam check ({ loads, materials, ... }), or mode:'fea' to solve the script's feaStudy (quadratic-tet FEA, CalculiX) — both return { ok, safetyFactor, elements[{ partName, stressPa, yieldPa, safetyFactor }], failures[], diagnostics }; fea adds the threshold, the stress regions as @kc[...] faces with their location, and fea { peakStressPa, maxDisplacementMm, meshTrusted, peakAtSupportPa, refinement }; it refines the mesh automatically until the stress is trusted (refine: false for one solve).
'static-hold' — gravitational holding torque/force at a sampled pose grid vs actuator capacities declared on arm.revolute / arm.prismatic joints ({ joint?, pose?, gravity?, min_torque_margin_pct?, range_samples? }). No actuator coverage returns ok:false with assembly.joint.static-hold.no-actuator; unavailable assembly mass properties return ok:false with assembly.joint.static-hold.mass-unavailable; mate-only mechanicalJoint chains are not evaluated; check their torqueNm ratings with 'motion-load' (quasi_static: true).
'motion-load' — loads on each driven joint (mechanicalJoint on a revolute mate) while the model moves: gravity, inertia from the animationView tracks (finite differences), optional external forces. Mass and inertia come from the solids and density/material, or a part's massKg. Returns per joint peak torque vs the mechanicalJoint torqueNm (margin; < 1x error, < 2x warning), axial / radial force and bending moment on the actuator shaft (checked only against radialLimitN / axialLimitN; without them 'no rating, not checked'), the radial load on each of up to two coaxial supports (each at its station on the shaft: the actuator at the joint origin, else the support's connector on the axis, else the middle of its material nearest the shaft; an ambiguous station is a mechanism.load.not-resolved warning, not a number), the worst pose, a torque-vs-time series, and
partLoads(the worst wrench per part and side in that part's own frame, whichfeaStudy({ loadsFrom })consumes) ({ file | code, motion_mode?: 'tracks'|'range'|'poses', motion_poses?: [{ joint: value }], sample_ms?, range_samples?, quasi_static?, gravity?, motion_loads?: [{ part, point, force, from_ms?, to_ms? }], supports?: { joint: [parts] }, series_points? }). Pass supports to compare with and without a bushing. Rigid bodies, tree mate graphs, no friction.'physics' — mechanism truth: rest-pose continuity, contact and interpenetration; budgeted joint-range collision/DOF sweep; and, when within the physics budget, static equilibrium and drop-on-release under gravity ({ file | code, assembly?, physics? }). Returns { ok, mechanism: 'real'|'broken'|'unverified', failures[], coverage }. A skipped sweep reports warning mechanism.unverified-budget-exceeded with coverage.sweep:false; a skipped physics pass reports warning mechanism.physics-budget-exceeded with coverage.physics:false. A closed-loop mate graph reports warning mechanism.physics-unsupported with coverage.physics:false and stays unverified: that rejection is unsupported topology, not a dynamics failure. Any of these skips leaves a clean mechanism unverified, but a completed rest-pose error still makes it broken. A physics budget skip occurs before MuJoCo runs.
'edge-radius' — general edge-break specification on final BREP ({ file | code, min_radius_mm?, max_radius_mm?, require_edge_break?: 'external'|'internal'|'all', feature_id?, assembly?, parts?, edges?, faces? }). Reports sharp convex/concave edges, analytic cylindrical/toroidal fillet radii and spherical junctions, and heuristic planar chamfer strips. Radius bounds apply only to fillets; selectors/points are part-local. Unknown/empty coverage cannot pass.
'clearance-range' — per mating pair, actual vs planned minimum clearance at rest and across the declared joint range ({ file | code, assembly?, min_clearance_mm?, samples_per_mate? }). Planned values come from solvedModel({}, { clearances }) and, for every movable (non-fastened) mate pair not declared there, from min_clearance_mm or dfmSpec({ minClearance }); ignored and declared-contact pairs are exempt. Poses are the pose-envelope samples (rest, each limited mate's min, interior and max, coupled mates driven through their source); distance is exact BREP. Each row { a, b, planned, plannedSource, at: rest|range, actual, worstSample, status: pass|fail|unknown, reason }. A movable mate with no limits, an unsolved pose or an unmeasured pair gives unknown, never pass; ok only when every row passes. All params except
checkare check-specific and forwarded verbatim; each check fails closed on its own missing required params. Iterating on a saved project: pass file "project:" pluspatch([{ old, new }], each old exactly once) instead of resending the script; nothing is saved until open_in_studio.
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": {
"check": "<check>"
},
"name": "verify"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dxf | No | check:'dfm-preflight' — path to a DXF file. | |
| code | No | Inline kernelCAD script source (same checks as `file`). | |
| file | No | Path to a .kcad.ts script (assembly/dfm/dfm-preflight/swept-collision/joint-range/reachable/mounting-holes/load-capacity/static-hold/geometry-quality/edge-radius/requirements). Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files. | |
| mode | No | check:'load-capacity' — 'beam' (default), 'stub', or 'fea' (solve the script's feaStudy: CalculiX + gmsh when installed, else the in-process voxel estimate). | |
| pose | No | check:'static-hold' — explicit pose (joint name -> deg/mm) or array of poses; omit to sample a grid across the evaluated joint's range. | |
| seed | No | check:'reachable' — numeric IK seed pose (joint name -> deg/mm). | |
| step | No | check:'joint-range' — coarse step in the joint's units (default 5 degrees or 2 mm). A contact thinner than one step can be missed. no-stop means those sampled poses found no crossing, not a continuous proof. | |
| check | Yes | Which verification to run. Omit only when passing call-time `requirements`; then the requirements ledger is the verification. | |
| edges | No | check:'edge-radius' — EdgeQuery or @kc[...] edge ref(s); intersected with faces. Query near sorts, it does not filter. | |
| faces | No | check:'edge-radius' — FaceQuery or @kc[...] face ref(s); includes incident edges and fillets on selected faces. | |
| joint | No | check:'swept-collision' — joint to sweep; omit to sweep every declared joint. check:'joint-range' — revolute or prismatic joint to measure; omit to measure every one. check:'static-hold' — joint to evaluate; omit to evaluate every joint with a declared actuator. | |
| loads | No | check:'load-capacity' — partName -> { force?: [Fx,Fy,Fz] N, torque?: [Tx,Ty,Tz] N*m }. | |
| parts | No | check:'edge-radius' — explicit assembly part names (default all). | |
| patch | No | Edit-and-test in place: use with file "project:<slug>" instead of resending the script. Each { old, new } replaces text that must occur exactly once in the saved source (no match or several matches is an error and nothing runs); edits apply in order. The tool runs on the patched source; nothing is saved and the saved project stays the base for the next call. To keep the change, call open_in_studio with project "<slug>" (no code) right after a successful evaluate_script (it saves that patched source). Not allowed together with `code`. | |
| range | No | check:'swept-collision' — [lower, upper, step] in joint-native units. | |
| study | No | check:'load-capacity' mode:'fea' — feaStudy name (default: the last declared one). | |
| refine | No | check:'load-capacity' mode:'fea' — one automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true); false solves once at the study's meshSize. | |
| search | No | check:'joint-range' — [min, max] search window in the joint's units. Overrides authored limits. A joint with no finite window is unknown, not clear. | |
| vendor | No | check:'dfm-preflight' — vendor SKU (required for that check). | |
| gravity | No | check:'static-hold' — gravity vector, m/s^2, world frame (default [0, 0, -9.81]). check:'assembly-path' with stability:true — gravity direction, world frame, magnitude ignored (default [0, 0, -1]). | |
| service | No | check:'dfm-preflight' — service. | |
| assembly | No | Assembly name; defaults to the first captured assembly. | |
| fixtures | No | check:'assembly-path' with stability:true — declared base/fixture part names, stable from step 1. Default: the lowest part(s) along gravity. | |
| heatmaps | No | check:'load-capacity' mode:'fea' — also render stress heatmap PNGs (default false). | |
| material | No | check:'dfm-preflight' — material SKU (required for that check). | |
| sequence | No | check:'assembly-path' — plan a build sequence { steps, model, unknown, search?, requiresForce?, toolBlocked?, needsHold? }. Fastened/fixed clusters become subassemblies planned inside and installed as one unit; steps carry the insertion direction (reverse removal), and may be motion: helical (declared fastener), requires-force (press/snap, not proven) or search. Stuck sets use a budgeted partition; non-straight paths found by sampling are labelled found-by-search and are not proven. Blocked and unknown parts are not reported as impossible. | |
| supports | No | check:'motion-load' — mechanicalJoint name -> support part names to use instead of the declared supports (compare with / without a bushing). | |
| tip_link | No | check:'reachable' — end-effector part name (required for that check). | |
| fasteners | No | check:'fastener-installation' — explicit named stations; empty means no coverage. | |
| materials | No | check:'load-capacity' — partName -> material declaration. | |
| mesh_size | No | check:'load-capacity' mode:'fea' — element size override, mm. | |
| sample_ms | No | check:'motion-load' — timeline sample step, ms (default 20). Inertia peaks depend on it at keyframe velocity steps. | |
| stability | No | check:'assembly-path' — run the approximate P3 static-stability pass on the sequence. Each part's closed-mesh volume centroid (uniform density) must project inside the convex hull of its contacts with already-stable parts. Unsupported parts become needsHold { part, reason, supports } and ok:false; a stable step may carry heldBy. Not a physics simulation. | |
| urdf_path | No | check:'urdf' — path to the .urdf file. | |
| directions | No | check:'assembly-path' — additional nonzero world-space removal vectors; normalized and deduplicated. | |
| feature_id | No | check:'geometry-quality' — body feature to measure; defaults to script return. check:'edge-radius' — lowered feature; default the returned model. | |
| resolution | No | check:'joint-range' — bisection tolerance in the joint's units (default 0.1 degrees or 0.05 mm). The reported stop is the clear side of the final bracket. | |
| motion_mode | No | check:'motion-load' — 'tracks' (default): along the animationView timeline with inertia; 'range': quasi-static grid over each driven joint's limits; 'poses': exactly motion_poses (a user-named pose is one entry). | |
| work_budget | No | check:'assembly-path' — positive finite per-call work allowance for mesh validation, acceleration builds and path checks. Default 8000000. Exhaustion remains unknown; job time and memory limits still apply. | |
| clearance_mm | No | check:'joint-range' — surface clearance the suggested stop protects, mm (default 0.3). | |
| motion_loads | No | check:'motion-load' — external forces: [{ part, point: [x,y,z] mm in the part's modeled frame, force: [Fx,Fy,Fz] N world, from_ms?, to_ms? }]. | |
| motion_poses | No | check:'motion-load' motion_mode:'poses' — explicit mate poses, each an object of joint name -> value in degrees. | |
| quasi_static | No | check:'motion-load' — drop velocity/acceleration terms (gravity and external loads only). | |
| requirements | No | Call-time external requirements ([{ name, predicate }]) measured in the same ledger as script require(), dfmSpec and feaStudy, tagged source: 'external' and never persisted. The predicate is the serializable form of require(): { metric: clearance | distance | mass | volume | bbox | centerOfMass | count | innerLoops | angle | concentric | coplanar, a?, b?, op: gte | lte | eq | between | within, limit, tolerance?, density? }. Operands are { kind: body | faces | edges | part, ref: <feature id/name or part name>, query? }. With `check` omitted the ledger is the whole verification; check 'requirements' is the explicit form. | |
| sweep_budget | No | check:'joint-range' — face-weighted exact BREP distance budget (default 40000). 0, or a probe that would pass the budget, returns unknown. Never a clear range. | |
| thickness_in | No | check:'dfm-preflight' — material thickness in inches. | |
| thickness_mm | No | check:'dfm-preflight' — material thickness in millimeters. | |
| tolerance_mm | No | check:'fastener-installation' — linear tolerance, default .05 mm. | |
| max_radius_mm | No | check:'edge-radius' — maximum fillet radius in mm; must be >= min_radius_mm. | |
| min_radius_mm | No | check:'edge-radius' — minimum fillet radius in mm (does not imply sharp-edge prohibition). | |
| prefer_solver | No | check:'reachable' — force the IK path ('auto' default). | |
| range_samples | No | check:'static-hold' — grid density per evaluated joint when `pose` is omitted (default 9). check:'motion-load' motion_mode:'range' — grid points per joint (default 5). | |
| series_points | No | check:'motion-load' — max torque-vs-time points per joint in the result (default 120; 0 omits the series). | |
| asserted_plane | No | check:'geometry-quality' — optional required mirror plane in model coordinates; normal is normalized and must be nonzero. | |
| max_iterations | No | check:'reachable' — numeric-path iteration cap. | |
| refresh_catalog | No | check:'dfm-preflight' — force vendor catalog refresh. | |
| target_position | No | check:'reachable' — target [x, y, z] mm (world frame). | |
| min_clearance_mm | No | check:'clearance-range' — planned clearance (mm) for movable mate pairs without a declared clearances entry; overrides dfmSpec minClearance. | |
| samples_per_mate | No | check:'clearance-range' — pose samples per limited mate: min, interior..., max (default 5). | |
| disassembly_order | No | check:'assembly-path' — iteratively remove freed parts and return removalOrder or stuckParts. | |
| mesh_deflection_mm | No | check:'geometry-quality' — absolute mesh deflection, defaults to tolerance/4; must be <= tolerance/2. | |
| require_edge_break | No | check:'edge-radius' — prohibit sharp convex/external, concave/internal, or all edges. | |
| target_orientation | No | check:'reachable' — target XYZ Euler angles in radians. | |
| threaded_fasteners | No | check:'assembly-path' — part names that need a helical removal. Catalog screw/bolt/nut families are detected automatically; without a fastened-mate fastener declaration (axis/pitch) they remain unknown: non-straight-path. Declare the motion on arm.mate(..., 'fastened', { fastener: { part, axis, pitchMm, tool? }, fit?: { kind, part? } }). | |
| tiny_face_area_mm2 | No | check:'geometry-quality' — flag faces strictly below this absolute area; zero disables. | |
| tiny_face_relative | No | check:'geometry-quality' — fraction of total BREP surface area, ORed with absolute threshold. | |
| angle_tolerance_deg | No | check:'fastener-installation' — axis tilt tolerance, default 1 degree. | |
| contact_tolerance_mm | No | check:'assembly-path' with stability:true — surface distance at or below which parts count as touching (default 0.05 mm). | |
| short_edge_length_mm | No | check:'geometry-quality' — flag edges strictly below this length; zero disables. | |
| min_torque_margin_pct | No | check:'static-hold' — safety-margin floor as a percent of actuator capacity (default 20). | |
| position_tolerance_mm | No | check:'reachable' — position tolerance in mm. | |
| symmetry_tolerance_mm | No | check:'geometry-quality' — maximum sampled mirror-to-mesh distance, mm. | |
| collision_tolerance_mm3 | No | check:'swept-collision' — BREP intersection volume tolerance (mm^3). | |
| safety_factor_threshold | No | check:'load-capacity' — pass/fail safety-factor floor (default 1.5; mode 'fea': the study's minSafetyFactor when declared). | |
| orientation_tolerance_rad | No | check:'reachable' — orientation tolerance in radians. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||