{"name":"com.kernelcad/kernelcad","slug":"kernelcad","title":null,"description":"Agent-first CAD: editable .kcad.ts source, deterministic review, OpenCASCADE kernel.","url":"https://mcp.market/server/kernelcad","rating":null,"grade":"B","score":78,"certified":false,"status":"active","category":"ai","tags":["ai"],"presence":{"score":44,"stars":25,"forks":3,"downloads_week":120,"last_push_at":"2026-09-25T01:01:54.000Z","license":"MIT"},"uptime":{"percent":100,"checks":28,"ok":28,"last_checked_at":"2026-09-27T14:41:57.383Z","last_ok_at":"2026-09-27T14:41:57.383Z","latency_ms":1161},"claimed":false,"transport":"mixed","callable_via_gateway":true,"default_price_micros":0,"repository":"https://github.com/w1ne/kernelCAD-web","website":null,"version":"0.11.2","remotes":[{"type":"streamable-http","url":"https://mcp.kernelcad.com/mcp"}],"packages":[{"registryType":"npm","identifier":"kernelcad","version":"0.11.2","transport":{"type":"stdio"}}],"tools":[{"name":"add_connector","description":"Use this when you need to add a mate connector to a part. Durably insert `<partBinding>.connector(name, { type, origin, axis?, normal? })` before the final top-level return. Use the part binding returned by add_part. Returns modified source plus diagnostics from re-evaluation. Side-effect-free.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"part_binding":{"type":"string","description":"JS identifier bound to an AssemblyPartRef, e.g. \"basePart\"."},"name":{"type":"string","description":"Connector name unique within the part."},"type":{"type":"string","enum":["frame","axis","planar","ball"]},"origin":{"description":"Origin as [x, y, z] shorthand, or a structured ConnectorOrigin.","oneOf":[{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"[x, y, z] shorthand."},{"type":"object","description":"Explicit numeric origin.","properties":{"kind":{"type":"string","enum":["vec3"]},"value":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3}},"required":["kind","value"]},{"type":"object","description":"Topology-derived origin.","properties":{"kind":{"type":"string","enum":["topology"]},"query":{"type":"object","properties":{"kind":{"type":"string","enum":["face-center","face-normal","vertex","edge-axis"]},"name":{"type":"string"}},"required":["kind","name"]}},"required":["kind","query"]}]},"axis":{"type":"array","items":{"type":"number"},"description":"Optional [x, y, z] axis."},"normal":{"type":"array","items":{"type":"number"},"description":"Optional [x, y, z] normal."}},"required":["code","part_binding","name","type","origin"]}},{"name":"add_constraint","description":"Use this when you need to add a sketch constraint to a list. Append one validated sketch constraint to a constraint list. Side-effect-free: pass { constraints, constraint } and receive the updated list.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"constraints":{"type":"array","description":"Existing constraint list to append to (omit for an empty list).","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["COINCIDENT","DISTANCE","HORIZONTAL","VERTICAL","PARALLEL","PERPENDICULAR","EQUAL_LENGTH","TANGENT","RADIUS","ANGLE","CONCENTRIC","SYMMETRIC"]},"entities":{"type":"array","items":{"type":"string"}},"value":{"type":"number"}},"required":["id","type","entities"]}},"constraint":{"type":"object","description":"The constraint to append.","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["COINCIDENT","DISTANCE","HORIZONTAL","VERTICAL","PARALLEL","PERPENDICULAR","EQUAL_LENGTH","TANGENT","RADIUS","ANGLE","CONCENTRIC","SYMMETRIC"]},"entities":{"type":"array","items":{"type":"string"},"description":"Ids of the entities the constraint relates."},"value":{"type":"number","description":"Required for DISTANCE, RADIUS, and ANGLE."}},"required":["id","type","entities"]}},"required":["constraint"]}},{"name":"add_curve","description":"Use this when you need a freeform/organic 3D curve — a body feature line, brow, spine rail, or G2 blend between panels — authored as a Curve3D into the user's .kcad.ts immediately before the last top-level return. One authoring path, selected by `kind`:\n- 'nurbs' — insert a `nurbsCurve(controlPoints, opts?)` declaration. Pass `controlPoints` as a Vec3[] (mm, at least 2 points). Optional NURBS knobs: `degree` (default 3), rational `weights`, explicit `knots`, `closed`.\n- 'hermite' — insert a `hermiteG2(a, b)` declaration: a quintic Hermite curve interpolating two endpoints with matching positions, tangents, and (optional) curvatures — bridges two curves with G2 continuity. Each endpoint is `{ point: Vec3, tangent: Vec3, curvature?: Vec3 }` in mm; tangent magnitude ~ chord length; curvature defaults to [0,0,0] (G1-only).\nThe returned binding has type Curve3D (peer to Shape / Surface) — consume it via `add_variable_sweep` (spine input), `add_surface({ kind: 'boundary' })` (boundary curve), or downstream Curve3D-accepting features. Returns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"kind":{"type":"string","enum":["nurbs","hermite"],"description":"Which curve-construction path to use."},"code":{"type":"string","description":"The .kcad.ts source code."},"controlPoints":{"type":"array","description":"kind:'nurbs' — control points as Vec3 triples in mm; at least 2 entries.","items":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3}},"degree":{"type":"integer","minimum":1,"description":"kind:'nurbs' — curve degree; default 3 (cubic)."},"weights":{"type":"array","description":"kind:'nurbs' — optional rational weights, one per control point (same length as controlPoints).","items":{"type":"number"}},"knots":{"type":"array","description":"kind:'nurbs' — optional explicit knot vector; missing => clamped-uniform inferred.","items":{"type":"number"}},"closed":{"type":"boolean","description":"kind:'nurbs' — optional periodic/closed-curve flag."},"a":{"type":"object","description":"kind:'hermite' — start endpoint.","properties":{"point":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"Endpoint position in mm."},"tangent":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"First derivative of the curve at this endpoint."},"curvature":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"Optional second derivative; defaults to [0, 0, 0] (G1-only)."}},"required":["point","tangent"]},"b":{"type":"object","description":"kind:'hermite' — end endpoint.","properties":{"point":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"Endpoint position in mm."},"tangent":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"First derivative of the curve at this endpoint."},"curvature":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"Optional second derivative; defaults to [0, 0, 0] (G1-only)."}},"required":["point","tangent"]},"binding_name":{"type":"string","description":"JS const name for the new Curve3D binding (default: _curve_<N>)."}},"required":["kind","code"],"allOf":[{"if":{"properties":{"kind":{"const":"nurbs"}}},"then":{"required":["controlPoints"]}},{"if":{"properties":{"kind":{"const":"hermite"}}},"then":{"required":["a","b"]}}]}},{"name":"add_feature","description":"Use this when you need to insert a new feature line into a script. Insert a new feature line into a kernelCAD script before the last top-level return statement. Returns the modified code as text plus diagnostics from re-evaluating the result. Side-effect-free. Primitives that accept faceLabels (box, cylinder, extrudeRect, extrudeCircle, extrudePolygon, extrudeRoundedRect) can receive `opts.faceLabels` in the inserted code — use `lookup_api` to see `featureKindFaceLabels` for the full value schema.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"feature_code":{"type":"string","description":"Single-statement source line to insert (e.g. `const hole = cylinder(5, 2).translate(10, 10, -1);`)."}},"required":["code","feature_code"]}},{"name":"add_mate","description":"Use this when you need to author a mate-graph relationship into the source, selected by `relation` (default 'mate'):\n- 'mate' — a typed mate between two connectors ({ name, a, b, type, pose?, limitsDeg?, limitsMm? }).\n- 'coupling' — couple a driven mate to a source mate by ratio ({ driven, source, ratio, offset? }).\n- 'transmission' — a physical drive path across mates ({ name, kind, sourceMate, drivenMates, path, ... }).\nAll durably edit source and need { code, assembly_binding }. Params other than `relation` are forwarded verbatim; each relation fails closed on its own missing required params.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"relation":{"type":"string","enum":["mate","coupling","transmission"],"description":"Which relationship to author (default 'mate')."},"code":{"type":"string","description":"The .kcad.ts source code."},"assembly_binding":{"type":"string","description":"JS identifier bound to assembly(...)."},"name":{"type":"string","description":"relation:'mate'|'transmission' — name unique within the assembly."},"a":{"type":"string","description":"relation:'mate' — connector ref \"<partName>.<connectorName>\"."},"b":{"type":"string","description":"relation:'mate' — connector ref \"<partName>.<connectorName>\"."},"type":{"type":"string","enum":["fastened","revolute","prismatic","cylindrical","planar","ball","pin_slot"],"description":"relation:'mate' — mate type."},"pose":{"description":"relation:'mate' — optional mate pose."},"limitsDeg":{"type":"array","items":{"type":"number"},"description":"relation:'mate' — optional [minDeg, maxDeg]."},"limitsMm":{"type":"array","items":{"type":"number"},"description":"relation:'mate' — optional [minMm, maxMm]."},"driven":{"type":"string","description":"relation:'coupling' — driven mate name."},"source":{"type":"string","description":"relation:'coupling' — source mate name."},"ratio":{"type":"number","description":"relation:'coupling' — driven pose = source pose * ratio + offset."},"offset":{"type":"number","description":"relation:'coupling' — optional pose offset."},"kind":{"type":"string","enum":["direct-horn","link-rod","four-bar","gear-pair","belt","tendon"],"description":"relation:'transmission' — transmission kind."},"sourceMate":{"type":"string","description":"relation:'transmission' — source mate name."},"drivenMates":{"type":"array","items":{"type":"string"},"description":"relation:'transmission' — driven mate names."},"actuator":{"type":"string","description":"relation:'transmission' — optional actuator."},"input":{"type":"string","description":"relation:'transmission' — optional input."},"output":{"type":"string","description":"relation:'transmission' — optional output."},"path":{"type":"array","items":{"type":"string"},"description":"relation:'transmission' — drive path."},"notes":{"type":"string","description":"relation:'transmission' — optional notes."}},"required":["code","assembly_binding"],"allOf":[{"if":{"anyOf":[{"not":{"required":["relation"]}},{"properties":{"relation":{"const":"mate"}},"required":["relation"]}]},"then":{"required":["name","a","b","type"]}},{"if":{"properties":{"relation":{"const":"coupling"}},"required":["relation"]},"then":{"required":["driven","source","ratio"]}},{"if":{"properties":{"relation":{"const":"transmission"}},"required":["relation"]},"then":{"required":["name","kind","sourceMate","drivenMates","path"]}}]}},{"name":"add_part","description":"Use this when you need to add a part to an assembly. Durably insert `const <binding> = <assembly>.part(partName, shapeExpression, opts?)` before the final top-level return in a kernelCAD source string. Returns modified source plus diagnostics from re-evaluating it. Side-effect-free: caller persists the returned source.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"assembly_binding":{"type":"string","description":"JS identifier bound to assembly(...), e.g. \"arm\"."},"part_name":{"type":"string","description":"Assembly-unique part name."},"shape_expression":{"type":"string","description":"JS expression for the Shape to pass to assembly.part, inserted verbatim."},"binding_name":{"type":"string","description":"Optional JS const name for the returned AssemblyPartRef. Defaults to a part-name-derived identifier."},"at":{"type":"array","items":{"type":"number"},"description":"Optional [x, y, z] assembly placement."}},"required":["code","assembly_binding","part_name","shape_expression"]}},{"name":"add_path_segment","description":"Use this when you need a freeform/organic 2D outline — an eyewear brow, ergonomic grip, sneaker midsole, or body silhouette — by appending a curved segment to an existing PathBuilder chain on the named `chain_anchor` variable. The call is injected at the END of the chain, immediately before any `.close()`. One segment kind, selected by `kind`:\n- 'spline' — `.spline(points, opts?)`: interpolates through every `points` waypoint (Vec2[] mm, >= 2 entries; points[0] must match current pen position). Optional `tension`, and `startTangent`/`endTangent` 2D direction vectors that constrain the first-derivative direction at the endpoints (magnitude normalised internally). Use for organic 2D outlines (eyewear brow, ergonomic handle, sneaker midsole).\n- 'nurbs' — `.nurbsSegment(controlPoints, opts?)`: explicit B-spline net (Vec2[] mm, >= degree+1 entries; controlPoints[0] must match pen; pen ends at controlPoints[N-1]). Optional `degree` (default 3), rational `weights` (strictly positive), explicit `knots` (length = controlPoints.length + degree + 1).\n- 'hermite' — `.hermiteG2(a, b)`: each endpoint `{ point: Vec2, tangent: Vec2, curvature?: Vec2 }` in mm (a.point must match pen; pen ends at b.point). `curvature` defaults to [0,0] (G1); pass matching curvatures for G2 blends. Tangent magnitude is the first derivative (~ chord length), NOT unit length.\nReturns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"kind":{"type":"string","enum":["spline","nurbs","hermite"],"description":"Which path-segment kind to append."},"code":{"type":"string","description":"The .kcad.ts source code."},"chain_anchor":{"type":"string","description":"JS identifier of an existing PathBuilder binding (e.g. `const brow = path().moveTo(0,0)`)."},"points":{"type":"array","description":"kind:'spline' — waypoints as Vec2 pairs in mm; at least 2 entries; first must match current pen position.","items":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2},"minItems":2},"tension":{"type":"number","description":"kind:'spline' — optional Catmull-Rom-style stiffness; forwarded to the underlying B-spline approximation."},"startTangent":{"type":"array","description":"kind:'spline' — optional [x, y] direction vector at points[0]. Magnitude is normalised internally; direction matters.","items":{"type":"number"},"minItems":2,"maxItems":2},"endTangent":{"type":"array","description":"kind:'spline' — optional [x, y] direction vector at points[N-1]. Magnitude is normalised internally; direction matters.","items":{"type":"number"},"minItems":2,"maxItems":2},"controlPoints":{"type":"array","description":"kind:'nurbs' — control-net vertices as Vec2 pairs in mm; at least degree+1 entries.","items":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2}},"degree":{"type":"integer","minimum":1,"description":"kind:'nurbs' — B-spline degree (default 3)."},"weights":{"type":"array","description":"kind:'nurbs' — optional rational weights (one per control point; strictly positive).","items":{"type":"number"}},"knots":{"type":"array","description":"kind:'nurbs' — optional explicit knot vector; length must equal controlPoints.length + degree + 1.","items":{"type":"number"}},"a":{"type":"object","description":"kind:'hermite' — start endpoint; point must match current pen position within 1e-6 mm.","properties":{"point":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"Endpoint position in mm."},"tangent":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"First derivative (~ chord length), NOT unit length."},"curvature":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"Optional second derivative; defaults to [0, 0] (G1-only)."}},"required":["point","tangent"]},"b":{"type":"object","description":"kind:'hermite' — end endpoint; pen ends at b.point.","properties":{"point":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"Endpoint position in mm."},"tangent":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"First derivative (~ chord length), NOT unit length."},"curvature":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"Optional second derivative; defaults to [0, 0] (G1-only)."}},"required":["point","tangent"]},"binding_name":{"type":"string","description":"Reserved for future use; the segment injection mutates the chain anchor in place."}},"required":["kind","code","chain_anchor"],"allOf":[{"if":{"properties":{"kind":{"const":"spline"}}},"then":{"required":["points"]}},{"if":{"properties":{"kind":{"const":"nurbs"}}},"then":{"required":["controlPoints"]}},{"if":{"properties":{"kind":{"const":"hermite"}}},"then":{"required":["a","b"]}}]}},{"name":"add_pattern_feature","description":"Use this when you need to repeat a feature in a pattern. Insert a Shape.patternLinear / .patternCircular / .patternGrid call into a kernelCAD script before the last top-level return. Pass structured args (kind + the matching spec object). Returns the modified code plus diagnostics from re-evaluating. Side-effect-free. The pattern feature is a single editable unit; pattern-instance face refs resolve via `<sourceId>_pattern_<i>` on the pattern feature's lineage. Geometric note: pattern is implemented as cumulative boolean union of transformed source copies — additive features (boxes, ribs, fins, spokes) pattern cleanly; patterning a subtractive feature (hole, cutout) only preserves the per-instance void when adjacent bodies are disjoint.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"target":{"type":"string","description":"Variable name of the Shape to pattern (inserted verbatim as the LHS receiver)."},"kind":{"type":"string","enum":["linear","circular","grid"]},"linear":{"type":"object","description":"Required when kind=linear.","properties":{"count":{"type":"integer","minimum":2},"direction":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3},"spacing":{"type":"number"}},"required":["count","direction","spacing"]},"circular":{"type":"object","description":"Required when kind=circular.","properties":{"count":{"type":"integer","minimum":2},"axis":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3},"angleDeg":{"type":"number","description":"Optional; defaults to 360."}},"required":["count","axis"]},"grid":{"type":"object","description":"Required when kind=grid.","properties":{"x":{"type":"object","description":"First grid axis.","properties":{"count":{"type":"integer","minimum":2},"direction":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3},"spacing":{"type":"number"}},"required":["count","direction","spacing"]},"y":{"type":"object","description":"Second grid axis.","properties":{"count":{"type":"integer","minimum":2},"direction":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3},"spacing":{"type":"number"}},"required":["count","direction","spacing"]}},"required":["x","y"]},"assign_to":{"type":"string","description":"Optional const-binding name; emits `const <assign_to> = <target>.patternX(...);`. Omit for statement form."}},"required":["code","target","kind"],"allOf":[{"if":{"properties":{"kind":{"const":"linear"}}},"then":{"required":["linear"]}},{"if":{"properties":{"kind":{"const":"circular"}}},"then":{"required":["circular"]}},{"if":{"properties":{"kind":{"const":"grid"}}},"then":{"required":["grid"]}}]}},{"name":"add_surface","description":"Use this when you need an organic, freeform, or swept shape — a body shell, panel, fairing, ergonomic curve, lens, or sculpted form — authored as a NURBS Surface into the user's .kcad.ts, OR when you need to finish surfaces into a watertight solid or taper faces for moldability. One authoring/finishing path, selected by `kind`:\n- 'nurbs' — insert a nurbsSurface(...) / surfaceFromCurves(...) call. Pass either { controls, degree, weights?, knots?, periodic? } for direct construction, OR { section_sketch_ids } for skinning. Weights are honored: supply rational weights to build exact circles/cylinders/spheres/conics (the surface becomes rational); omit weights for a non-rational surface.\n- 'boundary' — insert a surfaceFromBoundary([c1,c2,c3,c4], opts?) call: one NURBS face through 4 boundary Curve3D refs (bottom, right, top, left in loop order; adjacent endpoints must coincide within 1e-6 mm) via OCCT BRepOffsetAPI_MakeFilling.\n- 'trim' — insert a `<surface>.trimTo(<by>)` or `<surface>.split(<by>)` call. Pass `surface_binding` (the Surface variable name), `by_binding` (the cutter Surface variable name; Shape/Curve3D cutters are deferred to a later slice), and `op: 'trim'` (keep the largest imprinted piece) or `op: 'split'` (return both halves as a `[Surface, Surface]` tuple).\n- 'sew' — insert a `sew([s0, s1, ...], opts?)` call to stitch N surfaces into a closed watertight solid via OCCT BRepBuilderAPI_Sewing. Pass `surface_bindings` (array of Surface variable names). Use after trim/boundary to close patches into a solid: trim → sew → solid pipeline. Optional `tolerance` (mm, default 1e-6) and `require_closed` (emits feature.surface-sew.open-shell if result is not watertight).\n- 'draft' — insert a `<shape>.draft(angleDeg, { face, neutralPlane?, pullDir? })` call to taper the selected face(s) for mold release. Pass `shape_binding`, `angle_deg` (0–90), and `face` (canonical name, label, or FaceQuery descriptor). Lowering emits feature.draft.failed on invalid geometry.\nThe returned Surface produces no Shape until you chain .thicken(t) or .toShape() (do that via add_feature on the binding name). Returns the modified code + diagnostics. Each kind fails closed on its own missing required params.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"kind":{"type":"string","enum":["nurbs","boundary","trim","sew","draft"],"description":"Which surface-construction or surface-finishing path to use: 'nurbs' | 'boundary' | 'trim' | 'sew' | 'draft'."},"code":{"type":"string","description":"Current .kcad.ts source."},"controls":{"type":"array","description":"kind:'nurbs' — control-point grid for direct construction (controls[u][v] = [x, y, z], mm).","items":{"type":"array","items":{"type":"array","items":{"type":"number"}}}},"weights":{"type":"array","description":"kind:'nurbs' — optional rational weights, same grid shape as controls. Ignored in slice-1.","items":{"type":"array","items":{"type":"number"}}},"degree":{"type":"object","description":"kind:'nurbs' — degrees in U and V; each in [1, nU-1] / [1, nV-1].","properties":{"u":{"type":"integer","minimum":1},"v":{"type":"integer","minimum":1}},"required":["u","v"]},"knots":{"type":"object","description":"kind:'nurbs' — optional explicit knot vectors; missing => clamped uniform inferred.","properties":{"u":{"type":"array","items":{"type":"number"}},"v":{"type":"array","items":{"type":"number"}}}},"periodic":{"type":"object","description":"kind:'nurbs' — optional periodic flags per parametric direction.","properties":{"u":{"type":"boolean"},"v":{"type":"boolean"}}},"section_sketch_ids":{"type":"array","description":"kind:'nurbs' — existing sketch FeatureIds (2 or more) to skin a surface through, in order.","items":{"type":"string"}},"curve_bindings":{"type":"array","description":"kind:'boundary' — tuple of 4 existing Curve3D variable names (bottom, right, top, left) declared earlier in the source.","items":{"type":"string"},"minItems":4,"maxItems":4},"continuity":{"description":"kind:'boundary' — continuity grade applied to every edge ('C0' | 'C1' | 'C2'), or an array of 4 grades (one per edge, bottom/right/top/left order). Default 'C0'.","oneOf":[{"type":"string","enum":["C0","C1","C2"]},{"type":"array","items":{"type":"string","enum":["C0","C1","C2"]},"minItems":4,"maxItems":4}]},"sampling":{"type":"integer","minimum":1,"description":"kind:'boundary' — OCCT NbPtsOnCur sampling parameter (default 15)."},"binding_name":{"type":"string","description":"JS const name for the new binding (kind:'nurbs' default surface_<N>; kind:'boundary' default _surface_<N>; kind:'trim' default _trimmed_<N>; kind:'sew' default _sewn_<N>; kind:'draft' default _drafted_<N>)."},"surface_binding":{"type":"string","description":"kind:'trim' — JS variable name of the Surface to trim/split (must be declared in source)."},"by_binding":{"type":"string","description":"kind:'trim' — JS variable name of the cutter Surface (must be declared in source). Shape/Curve3D cutters are deferred."},"op":{"type":"string","enum":["trim","split"],"description":"kind:'trim' — 'trim' discards the smaller half (calls .trimTo()); 'split' retains both halves (calls .split())."},"surface_bindings":{"type":"array","description":"kind:'sew' — JS variable names of the surfaces to stitch into a solid (each must be declared in source).","items":{"type":"string"},"minItems":1},"tolerance":{"type":"number","description":"kind:'sew' — edge-merging tolerance in mm (default 1e-6). Edges within this distance are merged."},"require_closed":{"type":"boolean","description":"kind:'sew' — when true the lowerer emits feature.surface-sew.open-shell if the stitched result is not a watertight solid."},"shape_binding":{"type":"string","description":"kind:'draft' — JS variable name of the Shape to taper (must be declared in source)."},"angle_deg":{"type":"number","minimum":0,"maximum":90,"description":"kind:'draft' — draft angle in degrees [0, 90]. The face is tapered outward by this angle relative to the pull direction."},"face":{"type":"string","description":"kind:'draft' — face selector for the face(s) to taper. Accepts a canonical name (top/bottom/front/back/left/right), a user label declared via faceLabels, or a FaceQuery descriptor string."},"neutral_plane":{"type":"string","description":"kind:'draft' — parting-line face (the plane where drafted faces remain fixed). Defaults to `face` if omitted."},"pull_dir":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"kind:'draft' — demoulding direction as [x, y, z]. Defaults to the face normal at lower time."}},"required":["kind","code"]}},{"name":"add_text","description":"Use this when you need to author text into a kernelCAD script before the last top-level return. One authoring path, selected by `mode`:\n- 'sketch' — insert a sketch.text(...) call. The emitted sketch is chainable: pair with subsequent .extrude(...) / cut(...) edits to land an engraved or raised text feature.\n- 'emboss' — insert a `<shape>.embossText({...})` chained call onto an existing Shape `target`. Use for engraved brand text on faces (Ray-Ban temple, CE mark, model number). `depth > 0` raises text out of the face; `depth < 0` engraves text into the face. Lowers via replicad drawText → sketchOnFace → extrude → fuse|cut.\nDefault font is the runtime-bundled Liberation Sans. Side-effect-free; returns the modified code plus diagnostics from re-evaluating. Each mode fails closed on its own missing required params.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"mode":{"type":"string","enum":["sketch","emboss"],"description":"Which text-authoring path to use."},"code":{"type":"string","description":"The .kcad.ts source code."},"content":{"type":"string","description":"mode:'sketch' — text content (UTF-8, non-empty, non-whitespace)."},"size":{"type":"number","description":"mode:'sketch'|'emboss' — glyph cap height in mm (positive finite)."},"font":{"type":"string","description":"mode:'sketch' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans."},"align":{"type":"string","enum":["left","center","right"],"description":"mode:'sketch' — horizontal alignment relative to position (default left); mode:'emboss' — relative to the UV anchor (default center)."},"position":{"type":"array","items":{"type":"number"},"minItems":2,"maxItems":2,"description":"mode:'sketch' — [x, y] anchor in mm. Default [0, 0]."},"rotation":{"type":"number","description":"mode:'sketch' — CCW rotation in degrees around position (default 0); mode:'emboss' — CCW rotation in the face tangent plane (default 0)."},"bindAs":{"type":"string","description":"mode:'sketch' — emits `const <bindAs> = sketch.text(...)`; mode:'emboss' — emits `const <bindAs> = <target>.embossText(...);`."},"target":{"type":"string","description":"mode:'emboss' — variable name of the Shape to chain onto (inserted verbatim)."},"textContent":{"type":"string","description":"mode:'emboss' — text content (UTF-8, non-empty, non-whitespace)."},"depth":{"type":"number","description":"mode:'emboss' — signed extrusion depth in mm: positive emboss out, negative engrave in. Must be non-zero."},"face":{"type":"string","description":"mode:'emboss' — target face — canonical name ('top'/'bottom'/'left'/'right'/'front'/'back') or label."},"fontFamily":{"type":"string","description":"mode:'emboss' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans."},"anchorU":{"type":"number","description":"mode:'emboss' — U anchor in [0, 1] face-local (0=umin, 0.5=centre, 1=umax). Default 0.5."},"anchorV":{"type":"number","description":"mode:'emboss' — V anchor in [0, 1] face-local. Default 0.5."},"scaleMode":{"type":"string","enum":["original","native","bounds"],"description":"mode:'emboss' — Drawing.sketchOnFace scaling mode. Default original."}},"required":["mode","code"]}},{"name":"add_variable_sweep","description":"Use this when you need an organic swept solid whose cross-section changes along its length — a tapering body, horn, bottle, fairing, or duct — authored as a variable-section sweep along a spine. Insert a `variableSweep(spine, sections, opts?)` declaration into the user's .kcad.ts immediately before the last top-level return. The result is a Shape — chain `.translate(...)`, `.union(...)`, etc. via `add_feature`. `spine_binding` references an existing variable (Curve3D / Sketch / Vec3[]) in the source; each `sections[i].profile_binding` references an existing Sketch. Sections must be strictly increasing in `t` and span [0, 1]; first t=0, last t=1. Orientation is not exposed by this MCP tool until runtime orientation support is wired. Validates every binding exists in the source via regex before inserting (fast structured error vs capture-time stack). Returns the modified code + diagnostics. Side-effect-free.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"spine_binding":{"type":"string","description":"Existing variable name for a Curve3D / Sketch / Vec3[] declared earlier in the source."},"sections":{"type":"array","description":"Varying cross-sections along the spine; at least 2 entries, strictly increasing in `t`, first t=0, last t=1.","items":{"type":"object","properties":{"t":{"type":"number","description":"Spine parameter in [0, 1]."},"profile_binding":{"type":"string","description":"Existing Sketch variable name for this section."}},"required":["t","profile_binding"]}},"closed":{"type":"boolean","description":"Optional closed-sweep flag."},"continuity":{"type":"string","enum":["C0","C1","C2"],"description":"Inter-section continuity; default 'C1'."},"binding_name":{"type":"string","description":"JS const name for the new Shape binding (default: _sweep_<N>)."}},"required":["code","spine_binding","sections"]}},{"name":"add_workspace_target","description":"Use this when you need to declare a reachability target for a connector. Durably insert `<assembly>.workspace(connectorRef, { reachable, toleranceMm? })` before the final top-level return. Workspace targets are checked by solvedModel validation/review pose-envelope gates. Returns modified source plus diagnostics from re-evaluation.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"assembly_binding":{"type":"string","description":"JS identifier bound to assembly(...)."},"connector_ref":{"type":"string","description":"Connector ref \"<partName>.<connectorName>\"."},"reachable":{"type":"array","description":"World-frame Vec3 targets the connector must be able to reach.","items":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3}},"toleranceMm":{"type":"number","description":"Optional non-negative tolerance in mm."}},"required":["code","assembly_binding","connector_ref","reachable"]}},{"name":"capture_animation","description":"Use this when you need to render a script's animation timeline to a video. Capture a kernelCAD script's animationView({...}) timeline to an MP4 (ffmpeg) or a PNG frame sequence, verifying the sampled poses for part interference. FILE ONLY: pass { file } (a .kcad.ts path) — there is no { code } mode, because the capture engine renders from a file on disk (its relative lib.fromSTEP imports resolve against the script directory). MP4 by default; pass { frames_dir } to write frame-0000.png... and skip ffmpeg entirely (mutually exclusive with output_path). Animation-pose interference verification runs by default (keyframe times + segment midpoints) BEFORE any browser/ffmpeg cost; { no_verify: true } skips it and { verify_every: n } additionally samples every n-th frame time. Pass { focus } or { hide } (arrays of feature ids or assembly part names, mutually exclusive) to isolate parts in the rendered frames — same semantics as `kernelcad render --focus/--hide`; visibility is render-only and does NOT affect the pose verification. Collisions DO NOT fail the call — the artifact is still written as evidence with ok: true; read verified: false + the collisions[] array. ENVIRONMENT REQUIREMENT (identical to `kernelcad render`): capture drives a headless browser against a running studio dev server reachable at http://localhost:5173 (or the VITE_PORT override); there is no bundled-static serving mode yet, so the same dev-server precondition applies in a production MCP install. Returns { ok, output_path, frame_count, duration_ms, fps, verified, verify_skipped?, collisions: [{ t_ms, a, b, volume_mm3 }], diagnostics }.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .kcad.ts script with an animationView({...}) record. Required (no inline { code } mode)."},"output_path":{"type":"string","description":"MP4 output path; default <scriptDir>/<basename>-animation.mp4. Mutually exclusive with frames_dir."},"frames_dir":{"type":"string","description":"PNG-sequence mode directory: write frame-0000.png... and skip ffmpeg. Mutually exclusive with output_path."},"fps":{"type":"number","description":"Override the animationView record's fps."},"no_verify":{"type":"boolean","description":"Skip the animation-pose interference verification (default: verify on).","default":false},"verify_every":{"type":"integer","minimum":1,"description":"Additionally verify at every n-th frame time of the fps schedule (unioned with the keyframe sample set)."},"focus":{"type":"array","items":{"type":"string"},"description":"Show only matching feature ids / assembly part names in the rendered frames. Mutually exclusive with hide. Render-only; does not affect pose verification."},"hide":{"type":"array","items":{"type":"string"},"description":"Hide matching feature ids / assembly part names in the rendered frames. Mutually exclusive with focus. Render-only; does not affect pose verification."}},"required":["file"]}},{"name":"design_loop","description":"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. 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.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"goal":{"type":"string","description":"Original user design goal. Fed into every review_cad repair prompt."},"attempts":{"type":"array","description":"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.","items":{"type":"object","anyOf":[{"required":["file"]},{"required":["code"]}],"properties":{"id":{"type":"string"},"title":{"type":"string"},"file":{"type":"string","description":"Path to a .kcad.ts script on disk. Provide file or code."},"code":{"type":"string","description":"Inline kernelCAD script source. Provide file or code."},"visualReview":{"type":"object","description":"Optional. Evidence from the reviewing agent after rendering/opening screenshots. Accepted reviews must include screenshotPath, concrete findings, and all required checks passing.","properties":{"accepted":{"type":"boolean"},"screenshotPath":{"type":"string"},"findings":{"type":"array","items":{"type":"string"}},"checks":{"type":"array","description":"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.","items":{"type":"object","properties":{"code":{"type":"string"},"passed":{"type":"boolean"},"finding":{"type":"string"},"screenshotPath":{"type":"string"}},"required":["code","passed","finding"]}}},"required":["accepted","findings"]}}}},"assembly":{"type":"string"},"preserveInterfaces":{"type":"array","items":{"type":"string"},"description":"External mates, connector refs, part names, or behavioral interfaces the agent must preserve between attempts."},"includePoseEnvelope":{"type":"boolean","description":"Forwarded to review_cad. Default true."},"includeInterference":{"type":"boolean","description":"Forwarded to review_cad. Default true."},"samplesPerMate":{"type":"integer","minimum":1,"description":"Pose-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."},"combinatorial":{"type":"boolean","description":"Sample 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."},"epsilonMm3":{"type":"number","description":"Forwarded to review_cad."},"trackConnectors":{"type":"array","items":{"type":"string"},"description":"Connector refs to track across sampled poses."},"gripperAperture":{"type":"object","description":"Optional gripper aperture request forwarded to review_cad."},"stopOnPass":{"type":"boolean","description":"Stop after the first attempt that is functional and passes the quality gate. Default true."},"autoRevise":{"type":"boolean","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."},"requireVisualReview":{"type":"boolean","description":"Require screenshot-backed visualReview with structured checks before accepting an attempt. Default true; set false only for explicit non-visual batch checks."},"likenessProfile":{"type":"string","enum":["automotive"],"description":"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)."},"bodyLikeness":{"type":"object","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"},"wheels":{"type":"array","items":{"type":"object"}},"length_axis":{"type":"string","enum":["x","y"]},"still_verdicts":{"type":"array","items":{"type":"object"}},"require_stills":{"type":"boolean"}}},"requirePhysicalAcceptance":{"type":"boolean","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(...)."},"allowReviewWarnings":{"type":"array","items":{"type":"string"},"description":"Warning diagnostic codes the original prompt explicitly allows. Other review warnings keep the loop iterating even if review_cad is functionally ok."},"outputRecordPath":{"type":"string","description":"Optional JSON path to write a Studio-compatible build record."},"recordTitle":{"type":"string","description":"Optional title for the build record."}},"required":["goal","attempts"]}},{"name":"diff_geometry","description":"Use this when you need to know WHAT MATERIAL changed between two versions of a model, not just how much. The deeper sibling of diff_scripts: a volume delta alone is ambiguous (a boss that grew and a pocket that deepened report the same magnitude, and a part that only moved reports zero), so this tool answers it with geometry instead of pixels. Baseline is { baseFile } or { baseCode }; the revised side is either another script ({ file } or { code }) or the SAME script re-lowered with { params } overrides — a bag of declared param() name -> new value, which is the one-script form a parameter sweep actually asks for. Bodies pair by name and fall back to declaration-order positional pairing; anything left over is listed in `unmatched` and raises diff.body.unmatched. Per matched body it returns addedMm3 = volume(revised - base), removedMm3 = volume(base - revised), commonMm3 = volume(base ∩ revised) from OCCT booleans, exact bbox with min/max/extent deltas, face / edge / hole count deltas (hole counts reuse the cylindrical-hole detector), maxDeviationMm (two-sided discrete Hausdorff distance between the two surfaces), and a `verdict` — identical | moved | resized | topology-changed, precedence topology-changed > resized > moved > identical. Branch on the verdict; cite the numbers. Optional { render: true } also writes an overlay PNG (added green, removed red, unchanged material as a translucent ghost; the scene is a re-runnable .kcad.ts over lossless BREP sidecars) through the render_preview pipeline and fails open (the numeric diff is still returned) when that pipeline is unavailable. Read-only — never touches the active session.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"baseFile":{"type":"string","description":"Baseline script — path to a .kcad.ts file."},"baseCode":{"type":"string","description":"Baseline script — inline source."},"file":{"type":"string","description":"Revised script — path to a .kcad.ts file. Mutually exclusive with params."},"code":{"type":"string","description":"Revised script — inline source. Mutually exclusive with params."},"params":{"type":"object","additionalProperties":true,"description":"Param-override mode: re-lower the BASELINE with these declared param() values changed (e.g. { plateThickness: 8 }). Mutually exclusive with file/code. A name the baseline does not declare fails with the declared-param list in the message."},"render":{"type":"boolean","description":"Also render an overlay PNG — added material green, removed material red — via the render_preview pipeline. Off by default; the numeric table is the agent-facing evidence."},"out_dir":{"type":"string","description":"Directory for the overlay PNG, its STL inputs, and the generated overlay script. Default: a temp dir."}}}},{"name":"diff_scripts","description":"Use this when you need to see exactly what changed between two script versions. Structured geometric delta between two versions of a kernelCAD script — a baseline ({ baseFile } or { baseCode }) and a revision ({ file } or { code }). Returns agent-readable JSON: per-part added/removed/renamed/changed (volume mm³ + exact bbox deltas, numbers matching inspect({ of: 'part-stats' })), total interference-volume delta with per-pair detail, mate-graph changes (added/removed/changed mates incl. type, connectors, pose, limits), and param changes (value/min/max). Single-shape scripts diff as one \"(root)\" pseudo-part. Use after editing a script to verify exactly what changed physically before re-rendering. Read-only — never touches the active session.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"baseFile":{"type":"string","description":"Baseline script — path to a .kcad.ts file."},"baseCode":{"type":"string","description":"Baseline script — inline source."},"file":{"type":"string","description":"Revised script — path to a .kcad.ts file."},"code":{"type":"string","description":"Revised script — inline source."}}}},{"name":"drawing_to_cad","description":"Use this when the reference for a part is a 2D engineering drawing PDF (orthographic views with dimensions), not a photo. Deterministic, no vision model: reads the vector linework (stroke width, dash) and positioned text; classifies visible / hidden / center / dimension / extension lines; reads the title block scale, units and projection symbol; identifies front / top / side views by projection alignment (third- or first-angle); ties dimension text to its lines (⌀, R, 4×, ±, THRU, depth). Dimension values win over measured lengths. Rebuilds the part as the view silhouette extruded by the depth an orthogonal view shows, or a turned part revolved from its half-silhouette, plus holes from ⌀ circles with THRU or hidden-line depth. Returns `script` — a `.kcad.ts` with role-named params (width, thickness, holeDia, hole1X, dia1, step1Length …) — and `ledger`, an assumption ledger where stated dimensions are `visible`, symmetry-derived positions `inferred`, defaults `assumed` and an unstated depth `missing`; a dimension that disagrees with the linework keeps its value and records the disagreement as an open fact. With verify (default) the script is evaluated, re-projected through the svg-drawing view stage and compared: `fidelity.verdict` is match | partial | mismatch | failed with per-axis extents, hole diameters and per-view silhouette IoU. Pass `out` to write the script and its `<stem>.ledger.json` (resolve open facts with resolve_assumptions, then set_param). A scanned (raster-only) page fails with reference.drawing.raster-only — use trace_from_image for those.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"path":{"type":"string","description":"Path to the drawing PDF on the machine running kernelCAD."},"pdfBase64":{"type":"string","description":"The PDF inline, base64-encoded. Use this instead of `path` against a hosted kernelCAD server."},"page":{"type":"integer","minimum":1,"description":"1-based page to read. Default 1."},"projection":{"type":"string","enum":["third-angle","first-angle"],"description":"Override the projection angle read from the sheet (default: projection symbol or note, else third-angle)."},"out":{"type":"string","description":"Write the emitted script here (a .kcad.ts path); the ledger is written beside it as <stem>.ledger.json."},"verify":{"type":"boolean","description":"Evaluate the rebuilt part and compare it with the drawing. Default true."}}}},{"name":"evaluate_script","description":"Use this when you need to run a script and check it compiles. Run a kernelCAD .kcad.ts script and report pass/fail + feature count + diagnostics. When the scene is assembly-built (assembly().part(...) → .model()/.solvedModel()), also returns a parts summary { count, names } AND runs the mechanism-truth gate by default: the `mechanism` field reports real/broken/unverified and a broken mechanism (disconnected components / mechanism.orphan-part, self-collision, fastened drift, dof-mismatch) makes ok:false with the failures in diagnostics — multi-body assemblies need connectors + mates/joints (axis+revolute for shafts/hinges/gears; frame+fastened for rigid; or arm.revolute/.prismatic/.ball/.fixed). Pass { skipMechanismCheck: true } to opt out. Pass either { file: \"<path>\" } or { code: \"<inline source>\" }. Set { dryRun: true } for fast validation while iterating: transpile + capture + capture-light checks WITHOUT OCCT lowering, DFM gates, or meshing — milliseconds instead of seconds (100x+ on boolean/fillet-heavy scripts). A dry run catches script throws, capture-time API misuse, and assembly validity-gate failures, but NOT lowering failures or dfmSpec diagnostics; it leaves the active session untouched, so finish with a full (non-dry) evaluate_script before using session-dependent tools.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"dryRun":{"type":"boolean","description":"Fast validation only: skip OCCT lowering, DFM gates, and meshing. Does not set or clear the active session."},"skipMechanismCheck":{"type":"boolean","description":"Opt out of the default mechanism-truth gate. By default a full evaluation of an assembly-built scene runs checkMechanismTruth and returns a `mechanism` verdict (real/broken/unverified); a broken mechanism makes ok:false. Set true to skip the sweep entirely (no `mechanism` field, no cost). Ignored for dryRun and non-assembly scripts."}}}},{"name":"evaluate_sdf","description":"Use this when you need to sample a signed-distance field at a point. Sample the signed distance from an in-script sdf.* field at a 3D point. Returns { distance, inside, aabb, kind }. Distance is in mm; negative = inside the surface, 0 = exactly on the surface, positive = outside. Use this to verify SDF composition before calling sdf.materialize (which is the expensive step). The script must bind the SdfField via sdf.bind('<name>', field) and pass that name as fieldName. Hint: pass either { file } or { code }, plus { fieldName, point: [x,y,z] }.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"fieldName":{"type":"string","description":"sdf.bind binding name holding the SdfField."},"point":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"Sample point [x, y, z] in mm."}},"required":["fieldName","point"]}},{"name":"export","description":"Use this when you need to export geometry to a file. One exporter, selected by `target`:\n- target:'model' — export the script geometry to one file. Pass { file | code }, a required { output_path }, and { format }. Supported formats: stl (binary STL mesh), step (BREP CAD interchange), dxf (planar laser/waterjet profile from a Region or planar face), 3mf (slicer-friendly mesh with per-part colors), glb (web-viewer / AR with PBR materials), svg-drawing (third-angle engineering-drawing sheet: front/top/left + isometric views, hidden edges dashed, tangent edges thin, overall bounding-box dimensions, title block; assemblies are drawn with inter-part occlusion; pass options.annotations to dimension specific features instead of the bounding box; pass options.exploded { factor, mode } to explode the isometric cell, options.balloons to number parts from the BOM, and options.partsList for an item/name/qty/material table above the title block). overall bounding-box dimensions, title block; assemblies are drawn with inter-part occlusion; pass options.annotations to dimension specific features instead of the bounding box, options.autoAnnotate to derive datums A/B/C, grouped hole callouts with position tolerances, hole positions, overall size, radius and chamfer callouts, flatness and an ISO 2768 note from the geometry (the result carries drawing_report with placed / overlapped counts), and options.sections for real section views on any cutting plane). Robot descriptions: urdf (tree-topology robot description), srdf (motion-planning semantics layered over the URDF), sdf-gazebo (SDFormat 1.10 with native ball joints, closed loops, and solved per-link poses), usd-isaac (ASCII USD physics stage: PhysicsArticulationRootAPI root, one rigid body per link at its solved pose with mass / centre of mass / principal inertia, PhysicsFixedJoint/PhysicsRevoluteJoint/PhysicsPrismaticJoint per mate with token axis, two-sided joint frames and limits, UsdPreviewSurface materials from the part appearance, and joint drives only when declared in options.drives { <mate>: { stiffness, damping, maxForce?, targetPosition? } }; options.collisionApproximation is convexHull | convexDecomposition; planar/cylindrical/pin_slot/ball mates fail closed with export.usd.joint-unsupported). bom-csv / bom-json (bill of materials over assembly.model()/solvedModel(): one row per distinct part — grouped by geometry/catalog identity, not name — with real instance quantity, kind, material, density, mass, bbox, process hint, and catalog provenance for purchased parts; same numbers as inspect({ of: 'bom' })). urdf and sdf-gazebo also write one meshes/<part>.stl per link, and usd-isaac one meshes/<part>.usda mesh layer per link, next to output_path (reported in mesh_files) — ship the whole directory to the consumer. STL exports run a watertight verify by default; failures return ok: false with export.mesh.not-watertight (open-edge count + up to 5 crack-cluster locations) but the file is still written so the broken mesh can be inspected. Optional { feature_id } selects which feature to export (default: last). Optional { options } carries per-format options bag (see the kernelcad-mcp skill for the per-format keys: dxf layers/tolerance/unit, 3mf printUnit/embedSource, glb axis/draco).\n- target:'part' — export solved-assembly parts as individual binary STL files in their modeled (world-frame) positions. Pass { file | code }, plus { part, output_path } for one part or { output_dir } for all parts (files land at <output_dir>/<part>.stl). A watertight verify runs on every exported mesh by default and fails the call with export.mesh.not-watertight; unknown part names fail with export.part.not-found listing the valid names.\nPass { no_verify: true } to skip the watertight gate. All params except `target` are forwarded verbatim; each target fails closed on its own missing required params.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"target":{"type":"string","enum":["model","part"],"description":"Which exporter to run: 'model' (whole-script geometry to one file) or 'part' (per-part STLs from a solved assembly)."},"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"output_path":{"type":"string","description":"Destination path. target:'model' — the export file (required). target:'part' — single-part .stl path."},"format":{"type":"string","enum":["stl","step","dxf","3mf","glb","svg-drawing","urdf","srdf","sdf-gazebo","usd-isaac","bom-csv","bom-json"],"description":"target:'model' — output file format (required for that target)."},"feature_id":{"type":"string","description":"target:'model' — optional FeatureId to export; defaults to last."},"options":{"type":"object","description":"target:'model' — optional per-format options bag. Discriminator options.format must equal top-level format. dxf: { layers?, unit?: \"mm\"|\"cm\"|\"in\", tolerance? }. 3mf: { printUnit?: \"mm\"|\"cm\"|\"in\", embedSource? }. glb: { axis?: \"y-up\"|\"z-up\", draco?: false }. svg-drawing: { sheet?: \"a4\"|\"a3\", modelName?, date?, annotations?, exploded?: { factor, mode? }, balloons?, partsList?, sections?, autoAnnotate? }. svg-drawing annotations is an array of authored dimensions/notes, each { kind: \"linear\"|\"radius\"|\"diameter\"|\"angular\"|\"note\", view?: \"front\"|\"top\"|\"left\"|\"iso\", text?, offset? } plus kind-specific geometry: linear { from, to }, radius/diameter { edge: EdgeQuery }, angular { from: EdgeQuery, to: EdgeQuery }, note { at, text }. from/to/at anchors are an [x,y,z] model point, { edge: EdgeQuery } or { face: FaceQuery }. Supplying any annotation REPLACES the automatic bounding-box dimensions; an annotation whose query resolves to zero or multiple matches fails the export rather than being dropped. svg-drawing sections is an array of { plane: \"xy\"|\"xz\"|\"yz\"|{ origin, normal }, label } (any non-zero normal). svg-drawing autoAnnotate is true or { tolerance?: \"ISO2768-f\"|\"ISO2768-m\"|\"ISO2768-c\", datums?: \"auto\"|[{ label, face: FaceQuery }], include?: [\"datums\"|\"flatness\"|\"holes\"|\"hole-positions\"|\"overall\"|\"fillets\"|\"chamfers\"|\"general-tolerance\"] }; datums and tolerances declared in the script with shape.datum() / shape.tolerance() override the automatic ones."},"part":{"type":"string","description":"target:'part' — part name for single-part export, or 'all'."},"output_dir":{"type":"string","description":"target:'part' — destination directory (all-parts mode); files are <dir>/<part>.stl."},"no_verify":{"type":"boolean","description":"Skip the STL watertight verify gate.","default":false}},"required":["target"]}},{"name":"fea_summary","description":"Use this when you need a structural check's context without paying for a solve. Read-only: returns the stored summary of a previous run_fea (pass the same `output_dir`), whether the CalculiX + gmsh toolchain is available on this machine (with the install command when it is not), and the FEA material table with real E / Poisson / yield numbers so a grade is chosen against data rather than from memory. Never meshes, solves, or writes.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"output_dir":{"type":"string","description":"Directory a previous run_fea wrote to; omit for toolchain status + material table only."}}}},{"name":"fetch_part","description":"Use this when you need to download a catalog part as a STEP file. Resolve an id (or single-match query) to a part record and write its STEP file to the local cache. Bundled ids resolve offline; non-bundled ids require partsBaseUrl (or KERNELCAD_PARTS_BASE_URL). Returns the cache path plus a sha256 fingerprint.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"id":{"type":"string"},"query":{"type":"string"},"category":{"type":"string"},"family":{"type":"string"},"standard":{"type":"string"},"partsBaseUrl":{"type":"string","description":"Opt-in remote endpoint; no default value ships with kernelCAD."}}}},{"name":"find_part","description":"Use this when you need to find a part in the catalog. Discover bundled (and optionally remote) part-catalog records by fuzzy query and faceted filters. Tokens AND-combine; cross-facet filters AND-combine. Pass partsBaseUrl (or set KERNELCAD_PARTS_BASE_URL) to enable the remote tier; otherwise results are bundled-only.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"query":{"type":"string"},"category":{"type":"string"},"family":{"type":"string"},"standard":{"type":"string"},"tag":{"type":"string"},"limit":{"type":"number"},"source":{"type":"string","enum":["local","remote","auto"]},"partsBaseUrl":{"type":"string","description":"Opt-in remote endpoint; no default value ships with kernelCAD."}}}},{"name":"flatten_pattern","description":"Use this when you need the unfolded flat pattern of a bent sheet-metal part. Return the unfolded 2D flat-pattern of a bent sheet-metal Shape as a Region (outer polyline + holes + bend lines + sketch plane). Slice 1: at most 2 bends. Pass { file } or { code }; optional { featureId } to pick a specific Shape.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string"},"code":{"type":"string"},"featureId":{"type":"string"}}}},{"name":"get_latest_render","description":"Render a project's current model server-side and return it as an inline image so you can SEE what you built. Prefer open_in_studio for the happy path — it already includes an iso PNG preview in the same publish result when previewDelivered is true. Use this tool for a different `view`, a contact sheet (`view:\"all\"`), or when you only have a slug and are not publishing. Call with that `slug` to inspect whether the build looks right. CRITICAL — the image is rendered from the MODEL on the server; it does NOT reflect the user's Studio camera, zoom, or screen. NEVER ask the user to rotate, zoom, pan, move the camera, close a slider, or change their view to help you see — you cannot affect their screen and it cannot affect this render. To see a different angle, call this tool again with a different `view`. By DEFAULT (omit `view`, or `view:\"all\"`) it returns a CONTACT SHEET of all six canonical views in one labeled image — a 3×2 grid, top row [iso, front, right], bottom row [back, left, top] — so you can judge the model from every side regardless of its orientation (e.g. to find which side has the doors). Pass a single `view` (iso/front/back/left/right/top) for one large render of that angle. DETERMINISTIC: the same model + view always returns the same bytes — identical bytes are NOT a stale/lagging snapshot. If you changed the model, push it with open_in_studio FIRST, then re-render to see the change. The image is always current and never a blank capture. Colors and shading match Studio (same palette / base-material color). The slug is the capability: no OAuth for public/unlisted; private projects require the owner signed in. The PNG is base64-inlined as a real image block by default; pass `paths_only: true` for metadata only. No renderable geometry or a mesh failure → { ok: false, error, hint }, never a blank image.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"slug":{"type":"string","description":"Project slug from open_in_studio/get_project/a /p/<slug> link. The slug is the capability — public/unlisted projects need no OAuth; private projects require the owner to be signed in.","minLength":1},"view":{"type":"string","enum":["all","iso","front","back","left","right","top"],"description":"View to render. Default \"all\" = a labeled contact sheet of every canonical angle (iso/front/back/left/right/top) — best for judging the whole model. Pass a single view name for one large render of that angle."},"paths_only":{"type":"boolean","description":"Controls PNG delivery. Default false: base64-inline the rendered PNG so clients that cannot fetch a URL over HTTP (e.g. a sandboxed agent) can still see it. Set true to return only metadata (smaller response)."}},"required":["slug"],"additionalProperties":false}},{"name":"get_model_mesh","description":"Return the raw per-feature triangle mesh (positions/indices/normals) of a project's current model, by slug. For the in-chat 3D viewer widget to render geometry; delivered over the MCP Apps bridge. The slug is the capability: public/unlisted need no OAuth; private requires the owner signed in.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"description":"Project slug from open_in_studio/get_project."}},"required":["slug"],"additionalProperties":false}},{"name":"get_project","description":"Use this when you need to reopen a saved project or browse what the user has saved — it fetches a kernelCAD Studio project, or lists the signed-in user's saved projects. Pass `slug` (from a /p/<slug> link or a prior listing) to fetch that project's full .kcad source and metadata — then edit and open_in_studio with the same slug so the user's open tab updates live. Private projects require their owner's OAuth connection. OMIT `slug` to list the signed-in user's saved projects (most recently updated first); that listing mode requires the OAuth connection and does NOT paint. Paint phases: projectSaved/meshReady reflect fetch state; viewerPainted stays false until the widget acks display. Prefer open_in_studio (with code) to publish+paint — do NOT call get_model_mesh or get_latest_render for interactive paint.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"slug":{"type":"string","description":"The project slug from a listing or a /p/<slug> Studio link. Omit to list the signed-in user's saved projects.","minLength":1}},"additionalProperties":false}},{"name":"get_project_revision","description":"Fetch the exact immutable .kcad source and parameters captured at a prior `open_in_studio` version. Use this to read-after-write verify a release: pass the returned `slug` and `version`, then hash or inspect the returned source. Public/unlisted projects use the slug as capability; private projects require the owner's OAuth connection.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"description":"Project slug returned by open_in_studio."},"version":{"type":"integer","minimum":1,"description":"Positive immutable revision version returned by open_in_studio."}},"required":["slug","version"],"additionalProperties":false}},{"name":"inspect","description":"Use this when you need to read facts about a model. One reader, selected by `of`:\n- 'assembly' — physical assembly inventory (parts, bboxes, connectors, mates, disconnected solids).\n- 'robot' — URDF/SDFormat export preview (links, joints, planning groups, end-effectors, issues).\n- 'step' — inspect an imported STEP file.\n- 'shape' — volume / surfaceArea / bbox for one feature ({ feature_id? }).\n- 'mass' — mass, centre of mass, centroidal inertia tensor (inertia6 + 3x3 inertiaMatrix), principalMoments/principalAxes, symmetry flags, and optionally the radius of gyration about an arbitrary axis ({ feature_id?, density?, gyration_axis? }); density in kg/m^3, defaults to 1000 (water).\n- 'features' — features captured by the script (kind, id, params, transforms, suppression).\n- 'assemblies' — assembly intent (assemblies, parts, connectors, joints).\n- 'topology' — canonical face names + edge count for a feature ({ feature_id? }).\n- 'edges' — edges of a shape with optional EdgeQuery ({ feature_id?, query? }); returns @kc[...] refs.\n- 'face-edges' — boundary edges of a named canonical face ({ feature_id?, face_name }).\n- 'faces' — faces of a shape with optional FaceQuery ({ feature_id?, query? }); returns @kc[...] refs.\n- 'face-labels' — user-applied labels visible in the script.\n- 'mates' — mates captured by the script.\n- 'constraints' — sketch constraints captured by the script.\n- 'part-stats' — bundled parts-catalog statistics.\n- 'bend-table' — sheet-metal bend table for a flattened pattern.\n- 'params' — declared model parameters.\n- 'part-categories' — top-level part-catalog categories available in the bundled (and configured remote) catalog.\n- 'part-families' — part families within a category ({ category? }); count + exemplar ids per family.\n- 'bom' — bill of materials ({ assembly? }): one row per distinct part (grouped by geometry/catalog identity, not name) with real instance quantity, kind ('fabricated'|'purchased'), material, density, per-unit and total mass, bbox, a fabrication process hint, catalog provenance for purchased parts, and totals; `bom.*` diagnostics flag rows with no density source or missing catalog vendor info instead of guessing.\n- 'section' — numeric cross-section probe of a shape: area, perimeter, loop/hole counts, 2D bbox at a plane ({ feature_id?, plane | at+axis, stack?: { from, to, count, axis? } }). `stack` scans evenly spaced slices and returns `minAreaIndex`/`minAreaPosition` — use it to find the neck/thinnest cross-section along an axis.\n- 'continuity' — G0/G1/G2 classification of shared edges ({ feature_id?, edges? }); position gap, normal jump, curvature difference, worst-sample XYZ.\n- 'curvature' — per-face Gaussian and mean curvature min/max/mean, inflections, spikes ({ feature_id?, faces?, spike_factor? }).\nAll params except `of` are subject-specific and forwarded verbatim. Most subjects accept { file | code }.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"of":{"type":"string","enum":["assembly","robot","step","shape","mass","features","assemblies","topology","edges","face-edges","faces","face-labels","mates","constraints","part-stats","bend-table","params","part-categories","part-families","bom","section","continuity","curvature"],"description":"Which facts to read."},"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"assembly":{"type":"string","description":"of:'assembly'|'robot'|'bom' — assembly name; defaults to the first captured assembly."},"feature_id":{"type":"string","description":"of:'shape'|'mass'|'topology'|'edges'|'faces'|'face-edges'|'face-labels' — FeatureId; defaults to the last returned shape."},"density":{"type":"number","description":"of:'mass' — material density in kg/m^3 (steel 7850, aluminium 2700, ABS 1050). Defaults to 1000 (water); the response echoes the value used and flags when it was defaulted."},"gyration_axis":{"type":"object","description":"of:'mass' — optional axis in shape-local mm to report the radius of gyration about. Omit for centroidal quantities only; the result is density-independent and returned in mm.","properties":{"origin":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"A point on the axis, shape-local mm."},"direction":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"Axis direction; normalised internally, so it need not be a unit vector."}},"required":["origin","direction"]},"face_name":{"type":"string","enum":["top","bottom","left","right","front","back"],"description":"of:'face-edges' — canonical face name (required for that subject)."},"query":{"type":"object","description":"of:'edges'|'faces' — optional EdgeQuery/FaceQuery filter."},"category":{"type":"string","description":"of:'part-families' — optional top-level category to filter families by."},"plane":{"type":["string","object"],"description":"of:'section' — section plane. Either a cardinal name string 'xy'|'xz'|'yz', { plane: 'xy'|'xz'|'yz', offset? }, or { origin: [x,y,z], normal: [nx,ny,nz] }. Omit to use `at`+`axis`."},"at":{"type":"number","description":"of:'section' — single slice position along `axis` (mm)."},"axis":{"type":"string","enum":["x","y","z"],"description":"of:'section' — normal axis for `at` / `stack` (default 'z')."},"stack":{"type":"object","description":"of:'section' — dense scan: `count` slices evenly spaced from `from` to `to` along `axis`; response reports minAreaIndex/minAreaPosition.","properties":{"from":{"type":"number","description":"Start position along the axis (mm)."},"to":{"type":"number","description":"End position along the axis (mm)."},"count":{"type":"integer","description":"Number of evenly spaced slices (>= 1)."},"axis":{"type":"string","enum":["x","y","z"],"description":"Scan axis (default 'z')."}},"required":["from","to","count"]},"edges":{"description":"of:'continuity' — optional EdgeQuery or @kc[...] ref(s) limiting which shared edges are sampled."},"faces":{"description":"of:'curvature' — optional FaceQuery or @kc[...] ref(s) limiting which faces are sampled."},"spike_factor":{"type":"number","description":"of:'curvature' — spike sensitivity as a multiple of the face's Gaussian stddev (default 6)."}},"required":["of"]}},{"name":"lookup_api","description":"Use this when you need to list the kernelCAD script-runtime surface: global functions (box, path, selectEdges, helix, etc), Shape methods (fillet, sweep, lower, etc), Sketch methods (extrude, revolve, sweep), PathBuilder methods, EdgeQuery/FaceQuery key sets, and featureKindFaceLabels (which globals accept opts.faceLabels and valid value shapes). Use this to discover what is callable from a .kcad.ts script. Call this BEFORE concluding kernelCAD lacks a capability — its NURBS freeform surfacing (loft, sweep, boundary-fill, G2 blend) is easy to miss from tool names alone.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{}}},{"name":"lookup_authoring_skill","description":"Return the kernelcad-authoring SKILL.md body — conventions for writing .kcad.ts scripts (imports, parameters, evaluation contract, common pitfalls).\n\nUse this tool BEFORE generating CAD code if your MCP client does not list resources. Clients that do list resources should instead read `kernelcad://skills/authoring` directly — the contents are identical.\n\nINPUT: none. OUTPUT: { uri, mimeType, text } where `text` is the SKILL.md body.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{}}},{"name":"lookup_cookbook","description":"Use this when you need a canonical pattern snippet for a CAD task. Search the kernelCAD cookbook for canonical pattern snippets. Returns top-k snippets matching the natural-language query, ranked by BM25 over title/tags/keywords/trigger. Use when you need a canonical pattern for fillet-after-subtract, non-overlapping booleans, sketch-to-extrude flows, etc. Returns empty if no snippet scores above the relevance floor — proceed without cookbook help in that case.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"query":{"type":"string","description":"Natural-language description of what you want to do (e.g. \"round the rim of a hole\", \"build an L-bracket\")."},"k":{"type":"number","description":"Max snippets to return. Default 3, max 5.","default":3}},"required":["query"]}},{"name":"lookup_diagnostics","description":"Use this when you need the kernelCAD 26-code diagnostic catalogue with hint templates. Tiny one-shot call; useful for an agent that wants to pre-populate retry strategies. Hints are also inline on every emitted diagnostic — this tool just gives you the canonical list up front.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{}}},{"name":"mesh_summary","description":"Mesh a kernelCAD .kcad.ts source server-side and return a COMPACT geometry summary — overall bounds plus, per feature, its id, kind, triangle count, and bounding box.\n\nUse this to INSPECT a model's geometry without a viewer: confirm a part is the size/shape you expect, see how many triangles each feature contributes, or check that every feature produced geometry. This runs the full server-side OCCT pipeline (the same one the Studio renderer uses), so it evaluates modern sources (assembly, path, .material, …) that the legacy client worker cannot.\n\nINPUT: `source` (required) the .kcad.ts script text; `fileName` (optional) a label for diagnostics; `params` (optional) a map of parameter-name → number overrides applied before meshing (stateless slider recompute).\n\nOUTPUT: { ok, bounds, featureCount, features: [{ id, kind, triangleCount, bbox: { min:[x,y,z], max:[x,y,z] } }], failedFeatureIds, diagnostics }. `ok` is true when every feature meshed; `failedFeatureIds` lists features that failed to compile (and `ok` is then false). Raw vertex/index/normal arrays are NEVER returned — this is a summary only. To SEE the rendered model, call open_in_studio (includes PNG preview + viewer); use get_latest_render only for alternate views.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"source":{"type":"string","description":"The .kcad.ts script source to mesh.","minLength":1},"fileName":{"type":"string","description":"Optional file-name label used in diagnostics (does not affect geometry)."},"params":{"type":"object","description":"Optional map of parameter-name → numeric value, applied as overrides before meshing (stateless slider recompute).","additionalProperties":{"type":"number"}}},"required":["source"],"additionalProperties":false}},{"name":"mesh_to_features","description":"Use this when you are handed an STL, OBJ or 3MF of a mostly prismatic mechanical part (plate, bracket, spacer, flange, housing block) and need an EDITABLE kernelCAD model of it rather than a faceted lib.fromSTL import. Deterministic, measured, self-verifying: it welds and checks the mesh, segments planes and cylinders, picks the extrusion axis, slices each band and fits exact lines / arcs / circles, snaps near-round values (each snap recorded), then emits a readable .kcad.ts with named param()s — a revolve for concentric round stacks, extruded profiles otherwise, .hole()/.holes() for through, blind and counterbored bores (axial and side-drilled), .cutout() for pockets, .fillet() for constant-radius edge blends (radius measured on the sharp edge, edges grouped by radius and picked with the shortest exact edge query), boolean subtractions for what no drilling feature can reach. It then EVALUATES that script and compares it with the mesh: volume IoU (column ray casting) and symmetric surface deviation (max + RMS), over up to 4 refinement passes. Returns { script, ledger, fidelity: { maxDeviationMm, rmsMm, volumeIoU, verdict: faithful | approximate | failed, thresholds }, unmatchedRegions, features, passes }. A fillet or sharp reading is kept by which measures better; variable-radius blends and chamfers are reported, not forced. The verdict is computed from the numbers — faithful needs IoU >= minIoU AND max deviation <= maxDeviationMm AND a watertight mesh AND no unmatched region. Freeform surfaces, tilted planes and side bosses are listed in unmatchedRegions (reference.mesh.freeform-region-unmatched), never silently dropped. The ledger uses fact ids equal to param names, so resolve_assumptions on the written <out>.ledger.json yields paramOverrides for set_param. Pass { out } to write the script and ledger; the mesh itself is never modified.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .stl (binary or ASCII), .obj or .3mf mesh. One of file / data is required."},"data":{"type":"string","description":"Mesh bytes as base64 — use when the server cannot see your filesystem."},"format":{"type":"string","enum":["stl","obj","3mf"],"description":"Format override; default from the extension or the content."},"out":{"type":"string","description":"Write the emitted script to this .kcad.ts path and the assumption ledger to the sibling .ledger.json."},"minIoU":{"type":"number","description":"Volume IoU a faithful verdict requires. Default 0.98."},"maxDeviationMm":{"type":"number","description":"Max surface deviation (mm) a faithful verdict allows. Default max(0.25, 0.1 % of the bbox diagonal)."},"maxPasses":{"type":"number","description":"Refinement passes, 1–4. Default 4; stops early at the first faithful pass."},"weldToleranceMm":{"type":"number","description":"Vertex weld distance in mm. Default max(1e-4, 1e-6 × bbox diagonal)."},"maxTriangles":{"type":"number","description":"Refuse meshes above this triangle count instead of stalling. Default 300000."}}}},{"name":"open_in_studio","description":"Save/publish the current kernelCAD model AND display it in one step: persists the project, returns the interactive Studio viewer (MCP Apps / ChatGPT outputTemplate), and includes a PNG preview in the SAME tool result (image content + previewUrl when available). Use this when the user wants to SEE or share the model — do NOT call get_latest_render afterwards for the happy path; the preview is already here when previewDelivered is true. Pass the full `.kcad` source as `code` (optional if you just called evaluate_script — omitting reuses that last evaluated source). Multi-body assemblies must declare connectors + mates/joints before publish — otherwise evaluate_script fails with mechanism.orphan-part (disconnected components). Use type: 'axis' + revolute mates for shafts/hinges/gears; type: 'frame' + fastened for rigid mounts; or arm.revolute/.prismatic/.ball/.fixed. Connector types are only frame|axis|planar|ball. Pass `slug` from a previous call to update the same project in place; omit `slug` only for a new separate model. Status fields: ok=true means publish succeeded (under CDN, meshStatus ready/building; ok=false + meshStatus=failed means hard mesh persist failure — do not claim the viewer is ready). previewDelivered=true means this result carries a displayable PNG — only then may you tell the user a preview was shown. meshStatus mirrors get_project (ready|building|failed|missing). Under CDN, open_in_studio waits up to ~20s (OPEN_IN_STUDIO_MESH_SYNC_BUDGET_MS) for the revision mesh before returning; heavier publishes usually land meshStatus=ready. If still meshStatus=building + meshReady=false: TRANSIENT — meshUrl is the expected CDN pin; embed retries 404s. Poll get_project({slug}) until ready, or re-call open_in_studio with same code+slug — never treat building as permanent failure/404. ALWAYS pass `code` when you have it (avoid no_code_to_reuse); evaluate_script reuse is a fallback. Paint phases: projectSaved / meshReady / previewDelivered are set here; viewerPainted is ONLY true after widget ack (model context / widgetState) — never claim paint from this tool alone. Do NOT call get_model_mesh or get_latest_render for interactive paint. Pass include_preview:false to skip the rasterizer (save + viewer URLs only). Trigger phrases: \"open it in Studio\", \"let me see it\", \"show me the model\"; also call after you finish a build and after each meaningful revision while iterating. ORGANIC/CAR SUCCESS GATE: for final likeness claims pass likeness_profile:\"automotive\" (and body_bbox/wheels/still_verdicts, or a prior verify body-likeness pass for this code). If the gate fails, ok:false with DX reference.likeness.publish-blocked|gate-required — do not claim success. Omit likeness_profile for WIP previews only.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The full .kcad source of the model to open in Studio (the script you have been editing). Optional: omit to reuse the source from your most recent evaluate_script call.","minLength":1},"title":{"type":"string","description":"Optional human-readable title for the model (shown in Studio). Defaults to \"Model from Claude\"."},"parameters":{"type":"array","description":"Optional list of the model's editable parameters, so Studio can render parameter controls. Each item is one control derived from the .kcad params.","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40,"description":"Parameter identifier as used in the script (e.g. \"width\")."},"defaultValue":{"oneOf":[{"type":"number"},{"type":"boolean"},{"type":"string"}],"description":"Current/default value of the parameter; type matches `kind`."},"kind":{"type":"string","enum":["number","integer","boolean","string"],"description":"Control type Studio should render for this parameter."},"unit":{"type":"string","maxLength":8,"description":"Optional unit label shown next to the control (e.g. \"mm\", \"deg\")."},"min":{"type":"number","description":"Optional inclusive lower bound (numeric params)."},"max":{"type":"number","description":"Optional inclusive upper bound (numeric params)."},"step":{"type":"number","description":"Optional slider/step increment (numeric params)."},"description":{"type":"string","maxLength":200,"description":"Optional human-readable explanation of the parameter."}},"required":["name","defaultValue","kind"]}},"slug":{"type":"string","description":"Slug returned by a previous open_in_studio call. When given, updates that existing project in place (live-updating the user's open Studio tab) instead of creating a new one.","minLength":1},"include_preview":{"type":"boolean","description":"Default true: render an iso PNG preview into this same tool result (reuses the server render cache when this source was already rendered). Set false to skip rasterization and return save/viewer URLs only."},"likeness_profile":{"type":"string","enum":["automotive"],"description":"Hard success gate for organic/car bodies. When set, open_in_studio returns ok:false unless body-likeness is publishReady (inline body_bbox/wheels/still_verdicts, or a prior verify body-likeness pass for this exact code). Omit for WIP previews."},"body_bbox":{"type":"object","description":"Body AABB { min:[x,y,z], max:[x,y,z] } mm — for likeness_profile gate when no session attest."},"cabin_bbox":{"type":"object","description":"Optional cabin AABB for likeness gate."},"wheels":{"type":"array","description":"Wheel centres + radii for likeness gate [{ center:[x,y,z], radius }].","items":{"type":"object"}},"still_verdicts":{"type":"array","description":"Agent still checklist for likeness gate [{ code, passed, finding, view? }].","items":{"type":"object"}},"require_stills":{"type":"boolean","description":"Forwarded to body-likeness gate (default true)."},"attachments":{"type":"array","maxItems":32,"description":"Complementary project files referenced by relative path from the .kcad source.","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":240},"bytesBase64":{"type":"string"},"assetSha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["path"],"additionalProperties":false}}},"required":[],"additionalProperties":false}},{"name":"project_curve","description":"Use this when you need to wrap a 2D closed curve onto a 3D face. Insert a `<shape>.projectCurve({ source, face, scaleMode? })` chained call into a kernelCAD script. The `source` is the structured `{ kind: \"sketchCommands\", commands: [...] }` wire format the runtime API accepts. Wraps the curve onto the face along the face normal; pair with `.extrude(d)` / `.cut(...)` for raised or engraved logos on curved bodies. Open-wire projection (`asEdge: true`) is not implemented and is rejected at edit time. Side-effect-free; returns modified code plus diagnostics.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"target":{"type":"string","description":"Variable name of the Shape to chain onto."},"commands":{"type":"array","description":"Closed 2D path to wrap onto the face, as plain-number commands. Must start with a `moveTo` and end with a `close` (e.g. [{kind:\"moveTo\",x:0,y:0},{kind:\"lineTo\",x:2,y:0},{kind:\"lineTo\",x:2,y:2},{kind:\"close\"}]).","items":{"type":"object","properties":{"kind":{"type":"string","enum":["moveTo","lineTo","close"]},"x":{"type":"number"},"y":{"type":"number"}},"required":["kind"]}},"face":{"type":"string","description":"Target face — canonical name or label."},"scaleMode":{"type":"string","enum":["original","native","bounds"],"description":"Drawing.sketchOnFace scaling mode. Default original."},"asEdge":{"type":"boolean","description":"Open-wire (edge) projection. NOT IMPLEMENTED — rejected at edit time. Use a closed-curve projection (omit asEdge)."},"bindAs":{"type":"string","description":"Optional local variable name; emits `const <bindAs> = <target>.projectCurve(...);`."}},"required":["code","target","commands","face"]}},{"name":"query","description":"Use this when you need to resolve or inspect topology against a script's lowered geometry. Selected by `mode` (default 'evaluate'):\n- 'evaluate' — inspect a Query (@kc[...] ref, @kcq[...] DSL, or { ast }); returns matched entities. Pass expect:'unique' to assert exactly-one.\n- 'resolve' — resolve a single @kc[...] / @kcq[...] ref to one entity ({ ref }).\n- 'lineage' — walk the HistoryMap for a named face ref ({ feature_id, ref }).\nAll params except `mode` are forwarded verbatim.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"mode":{"type":"string","enum":["evaluate","resolve","lineage"],"description":"Resolution mode (default 'evaluate')."},"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"query":{"description":"mode:'evaluate' — Query input: @kc[...] / @kcq[...] string or { ast } object."},"ref":{"type":"string","description":"mode:'resolve'|'lineage' — topology ref string."},"expect":{"type":"string","enum":["any","unique"],"description":"mode:'evaluate' — 'unique' asserts exactly-one."},"feature_id":{"type":"string","description":"Optional FeatureId; defaults to the last lowered shape (use \"auto\" for lineage)."}}}},{"name":"remove_feature","description":"Use this when you need to remove a feature line from a script. Remove a single line from a kernelCAD script identified by a substring match. Returns the modified code plus diagnostics from re-evaluating. Refuses to remove the line containing the return statement. Side-effect-free.","write_action":true,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"match":{"type":"string","description":"A substring that uniquely identifies the line to remove (e.g. `const hole = cylinder(5,`)."}},"required":["code","match"]}},{"name":"render_preview","description":"Use this when you need to LOOK at a kernelCAD model — render its script to deterministic PNG views for visual self-check (the visual half of the evaluate → render → inspect → fix loop), with NO studio or dev server required. Pass { code } (inline source) or { file } (a .kcad.ts path), exactly one. Renders the canonical engineering views (front, right, top, iso — pass { views } for a subset, e.g. [\"iso\"] for fastest iteration) plus an optional { pose: \"<az>,<el>\" } arbitrary camera angle (degrees; az=0,el=0 is front, +az rotates CCW around +Z, +el lifts the camera). NO STUDIO / DEV-SERVER REQUIRED: a prebuilt static player (dist/headless-player) is served from an ephemeral local port automatically; a running studio dev server is used as fallback, and { base_url } forces one. The only environment dependency is playwright chromium (npx playwright install chromium). Pass { focus } or { hide } (arrays of feature ids or assembly part names, mutually exclusive) to isolate parts — same semantics as `kernelcad render --focus/--hide`. Pass { section: { axis, position, flip? } } to cut a cross-section and inspect INTERIOR geometry (wall thickness, internal pockets, whether a bore runs through) rather than only the outer shell. Pass { explode: { factor, mode? } } to pull a multi-part assembly apart (mode: \"mate-axis\" default, or \"radial\") using the same mesher as `kernelcad render --explode` — requires assembly.model()/solvedModel(). PNGs are written to { out_dir } (default: a fresh temp session directory) and returned as absolute paths with per-view camera descriptions (kernelCAD is Z-up). Mechanism truth runs first, same protocol as `kernelcad render`: a broken mechanism still renders but every tile is watermarked MECHANISM BROKEN (KERNELCAD_RENDER_STRICT=1 refuses instead); read { mechanism, mechanism_failure_codes }. The probe runs full BREP interference sweeps and can dominate latency on large assemblies — pass { no_mechanism_check: true } for fast iteration (the preview then reports mechanism: \"unverified\"; ignored under strict mode). Pass { overlay: 'zebra' | 'curvature' | 'continuity' } for a surface-quality visualisation (zebra stripes from vertex normals, curvature as vertex colours, continuity edges coloured by G0/G1/G2/broken) — numbers come from inspect({ of: 'continuity' | 'curvature' }); the overlay is the picture. Returns { ok, images: [{ name, path, description }], out_dir, bounds, mechanism, render_source, render_ms, diagnostics }. PATHS ARE LOCAL to the machine running the MCP server — local stdio clients read them directly; hosted/remote clients should use open_in_studio instead.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"Inline kernelCAD script source. Mutually exclusive with file. Relative imports resolve against a temp dir — use file for scripts with relative lib.fromSTEP(...) imports."},"file":{"type":"string","description":"Path to a .kcad.ts script on disk. Mutually exclusive with code."},"views":{"type":"array","items":{"type":"string","enum":["front","right","top","iso"]},"description":"Canonical views to render as an array, e.g. [\"iso\"] or [\"front\",\"top\"] (default: all four). Fewer views = faster."},"pose":{"type":"string","description":"Extra arbitrary camera pose '<az>,<el>' in degrees, e.g. '30,20'."},"focus":{"type":"array","items":{"type":"string"},"description":"Show only matching feature ids / assembly part names. Mutually exclusive with hide."},"hide":{"type":"array","items":{"type":"string"},"description":"Hide matching feature ids / assembly part names. Mutually exclusive with focus."},"out_dir":{"type":"string","description":"Directory for the PNGs (created if missing). Default: a fresh temp session dir."},"width":{"type":"integer","minimum":64,"maximum":2048,"description":"Per-view tile width in px (default 768)."},"height":{"type":"integer","minimum":64,"maximum":2048,"description":"Per-view tile height in px (default 768)."},"environment":{"type":"string","description":"HDRI environment override: preset ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse'), a URL, or 'none' for the default three-light rig."},"no_watermark":{"type":"boolean","description":"Suppress the kernelCAD version watermark.","default":false},"no_mechanism_check":{"type":"boolean","description":"Skip the mechanism-truth probe for fast iteration on large assemblies; the preview reports mechanism: 'unverified'. Ignored under KERNELCAD_RENDER_STRICT=1.","default":false},"base_url":{"type":"string","description":"Advanced: force a specific render server (e.g. a running studio dev server) instead of the bundled static player."},"section":{"type":"object","description":"Cut the model with one axis-aligned section plane to inspect INTERIOR structure (wall thickness, internal pockets, whether a bore runs through) instead of only the outer shell. position is in mm along the axis (kernelCAD Z-up frame); flip keeps the +axis side (default keeps the -axis side).","properties":{"axis":{"type":"string","enum":["x","y","z"]},"position":{"type":"number"},"flip":{"type":"boolean","default":false}},"required":["axis","position"],"additionalProperties":false},"explode":{"type":"object","description":"Pull a multi-part assembly apart for the preview. factor ≥ 0 scales spacing by part size; mode is 'mate-axis' (default, along parent mate/joint axes) or 'radial' (away from the assembly centroid). Requires the script to return assembly.model() / solvedModel().","properties":{"factor":{"type":"number","minimum":0},"mode":{"type":"string","enum":["radial","mate-axis"]}},"required":["factor"],"additionalProperties":false},"overlay":{"type":"string","enum":["zebra","curvature","continuity"],"description":"Surface-quality overlay: 'zebra' (reflection stripes), 'curvature' (Gaussian vertex colours), 'continuity' (edges coloured G2 green / G1 yellow / G0 orange / broken red). Built as coloured STL bands through this same pipeline."}}}},{"name":"repair_script","description":"Use this when evaluate_script reported an error and you want the fix applied rather than described. Takes the candidates why_did_this_fail derives for a diagnostic, applies them one at a time, re-evaluates after each, and keeps the first that clears the diagnostic without introducing new errors. Never edits outside the repair region (failing feature statement + its input statements + the param() lines it reads) — an out-of-region patch is refused with tool.repair.out-of-region. Returns the repaired source in `new_code` (the caller persists it), a unified `diff`, and before/after health maps. Pass { file? | code?, diagnostic?: '<id>'|'first-error', strategy?: 'apply-first'|'try-all'|'dry-run', max_attempts?: number }.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"diagnostic":{"type":"string","description":"Diagnostic id from why_did_this_fail's `targetDiagnosticId` / `candidates[].diagnosticId`, or 'first-error' (default) for the first error-severity diagnostic."},"strategy":{"type":"string","enum":["apply-first","try-all","dry-run"],"description":"'try-all' (default) walks candidates until one clears the diagnostic; 'apply-first' applies only the top candidate and reports what it did; 'dry-run' previews every candidate patch without evaluating."},"max_attempts":{"type":"integer","minimum":1,"maximum":10,"description":"Upper bound on candidates attempted (default 3). Ignored by apply-first and dry-run."}}}},{"name":"resolve_assumptions","description":"Use this when you need to confirm or override the open facts in an assumption ledger from trace_from_image (missing scale, inferred/assumed values) before committing geometry built from a reference photo. Reads the persisted `<model>.ledger.json` at `ledgerPath`, applies each resolution — `{ id, confirm: true }` to accept a fact as-is, or `{ id, value }` to override it — rewrites the ledger file, and returns the updated ledger plus `paramOverrides` (factId -> value) to feed straight into `set_param`. Pair with the `kernelcad-from-reference` skill.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"ledgerPath":{"type":"string","description":"Path to the `<model>.ledger.json` file persisted alongside the traced source."},"resolutions":{"type":"array","description":"One resolution per ledger fact id to act on.","items":{"type":"object","properties":{"id":{"type":"string","description":"Matches a `facts[].id` in the ledger."},"value":{"description":"Overrides the fact's value; marks it `overridden`."},"confirm":{"type":"boolean","description":"Accepts the fact as-is; marks it `confirmed`."}},"required":["id"]}}},"required":["ledgerPath","resolutions"]}},{"name":"review_cad","description":"Use this when you need to review a mechanism for fitness and repair mode. Run the deterministic CAD review loop: evaluate the script, validate the assembly/mate graph, check mate connectors touch modeled material, sample declared mate limits, optionally check interferences at sampled poses, report connector workspace bounds, and return a mechanism fitness verdict for agent self-review. Fitness includes repairMode: none, local-fix, parameter-tune, or topology-redesign.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"assembly":{"type":"string","description":"Assembly name; defaults to the first captured assembly."},"designGoal":{"type":"string","description":"Original user design prompt or goal. Included in suggestedRepairPrompt so topology-redesign repairs restart from the intended physical design instead of local coordinate nudges."},"preserveInterfaces":{"type":"array","description":"External mates, connector refs, part names, or behavioral interfaces the repair agent must preserve during redesign.","items":{"type":"string"}},"includePoseEnvelope":{"type":"boolean","description":"Whether to sample declared mate limits. Default true."},"includeInterference":{"type":"boolean","description":"Whether sampled poses run BREP interference checks. Default true."},"requirePhysicalUseCase":{"type":"boolean","description":"When true, articulated assemblies must declare arm.physicalUseCase(...) evidence: loads, contacts, stable parts, and actuator limits."},"includePhysicalUseCaseReachability":{"type":"boolean","description":"Run targeted physical-use-case reachability sampling over scalar-limited mates named in actuatorLimits. Reject contacts that cannot get within criteria.maxSlipMm and multi-contact use cases that cannot satisfy every contact in the same sampled actuator pose. Samples revolute/cylindrical/pin-slot limitsDeg and prismatic limitsMm. Defaults to requirePhysicalUseCase."},"includePhysicalUseCaseStatics":{"type":"boolean","description":"Run opt-in pose-bound quasi-static certification at the exact common-contact samples: conservative friction/capacity, world force and moment balance, and finite-difference revolute actuator torque. Returns physicalUseCaseStaticCertificates on success; sampled linearized failures remain blocking diagnostics."},"includePhysicalUseCaseJointReactions":{"type":"boolean","description":"Derive exact-pose reaction wrenches through uniquely rooted articulated trees and compare every loaded mate against a complete declared resultant force/moment envelope. Implies physical-use-case reachability and statics."},"includePhysicalUseCaseJointStructure":{"type":"boolean","description":"Run geometry/material clevis double-shear, pin-bending, bearing, tear-out, and net-section checks with minimum factor of safety 2. Unsupported axial or perpendicular-moment load cases remain blockers. Implies joint reactions, statics, and reachability."},"physicalUseCaseReachabilitySamplesPerMate":{"type":"integer","minimum":1,"description":"Samples per scalar-limited actuator mate for physical-use-case contact reachability. Samples revolute/cylindrical/pin-slot limitsDeg and prismatic limitsMm. Default 3; total targeted combinations are capped."},"samplesPerMate":{"type":"integer","minimum":1,"description":"Pose-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."},"combinatorial":{"type":"boolean","description":"Sample 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."},"epsilonMm3":{"type":"number","description":"Interference volume threshold in mm^3. Default 0.01."},"trackConnectors":{"type":"array","description":"Optional connector refs such as [\"gripper-plate.tool-tip\"] to limit connector workspace reporting.","items":{"type":"string"}},"gripperAperture":{"type":"object","description":"Optional fingertip connector refs for gripper aperture travel reporting.","properties":{"left":{"type":"string","description":"Left fingertip connector ref such as \"left-finger.tip\"."},"right":{"type":"string","description":"Right fingertip connector ref such as \"right-finger.tip\"."}}}}}},{"name":"review_paint_peek_latest","description":"Return the newest brush-painted review packet from a Studio session. After sharing a /p/<slug> link, the user can open it in the browser and paint marks over the 3D viewport to give visual feedback. Call this tool with the `slug` from that link to see the strokes — screenshot + mask + struck part names plus an optional one-line note and intent tags (e.g. \"too thick\", \"missing\", \"wrong angle\") describing WHAT is wrong — and act on the feedback. The slug is the capability: no OAuth required when passing `slug`; private projects require the owner to be signed in. Omit `slug` to fetch your own latest packet from your signed-in account (requires OAuth). By default returns short-lived signed Storage URLs for the screenshot + mask + meta.json plus the struck part names — small and context-friendly. Pass `paths_only: false` to also base64-inline the PNGs for clients that cannot fetch the signed URLs over HTTP.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"slug":{"type":"string","description":"Project slug from open_in_studio/get_project/a /p/<slug> link. When given, returns the latest brush packet painted on that project's page — works without OAuth; the slug is the capability. Omit to use your signed-in account's latest packet."},"freshness_sec":{"type":"integer","description":"Maximum packet age in seconds. Default 1800 (30 min). Use a smaller value for \"what did I just paint\" or a larger one for \"earlier today\".","minimum":1},"paths_only":{"type":"boolean","description":"Controls PNG delivery. Default (omitted or true): return only signed URLs + struck part names — the small, context-friendly response; fetch the bytes via the signed URLs. Set false to also base64-inline the screenshot + mask PNGs for clients that cannot fetch the URLs over HTTP (larger response)."}},"additionalProperties":false}},{"name":"run_fea","description":"Use this when you need to know whether a part will hold a load. Runs the linear-static structural study a script declares with `shape.feaStudy({ material, fixed, loads, meshSize?, minSafetyFactor? })`: meshes the solid with quadratic tetrahedra, solves it with CalculiX, and returns evidence — peak von Mises stress (MPa), peak displacement (mm), the minimum safety factor against the material yield, per-region hot spots named by @kc[...] face ref, mesh-quality trust flags, an equilibrium residual, and stress-heatmap PNG paths.\nRequires the external solver toolchain (CalculiX `ccx` plus the gmsh Python module). When it is absent the call fails with `fea.solver.unavailable` and the exact install command — never a silent pass.\nPass { file | code }, optional `study` (defaults to the last declared study), `output_dir` (keeps the .inp/.frd deck for reproduction), `mesh_size` (mm, overrides the study for this run), and `heatmaps: false` for a fast numbers-only run.","write_action":true,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .kcad.ts script declaring at least one feaStudy."},"code":{"type":"string","description":"Inline kernelCAD script source (mutually exclusive with file)."},"study":{"type":"string","description":"Name of the study to run; defaults to the last declared one."},"output_dir":{"type":"string","description":"Directory for the solver deck, results, summary JSON and heatmap PNGs."},"mesh_size":{"type":"number","description":"Target element size in mm, overriding the study for this run."},"heatmaps":{"type":"boolean","description":"Render stress heatmap PNGs (default true)."},"mesh_timeout_ms":{"type":"number","description":"Wall-clock budget for meshing (default 120000)."},"solve_timeout_ms":{"type":"number","description":"Wall-clock budget for the solve (default 300000)."}}}},{"name":"send_to_printer","description":"Use this when you need to upload a .gcode file (e.g. written by export with target: \"model\", format: \"gcode\") to a real network printer and, by default, start the print. protocol: 'octoprint' (POST /api/files/local with an X-Api-Key), 'moonraker' (Klipper's POST /server/files/upload), or 'bambu-lan' (Bambu Lab LAN-mode: FTPS implicit-TLS upload on port 990 as user 'bblp' with the printer's LAN access code, then an MQTT print-start command on port 8883 — requires access_code and, unless start_print is false, serial). Pass { dry_run: true } to validate connectivity/authentication only, without uploading or starting a print. Never logs or echoes api_key/access_code.","write_action":true,"price_micros":0,"input_schema":{"type":"object","properties":{"gcode_path":{"type":"string","description":"Path to the .gcode file on disk."},"protocol":{"type":"string","enum":["octoprint","moonraker","bambu-lan"]},"host":{"type":"string","description":"Printer hostname or IP."},"port":{"type":"number","description":"Override the protocol default port."},"api_key":{"type":"string","description":"OctoPrint API key (Settings -> API)."},"access_code":{"type":"string","description":"Bambu LAN-mode access code (printer settings -> LAN Only Mode)."},"serial":{"type":"string","description":"Bambu printer serial number (required to start a print unless start_print is false)."},"filename":{"type":"string","description":"Uploaded file name (default: 'kernelcad.gcode')."},"start_print":{"type":"boolean","description":"Start the print immediately after upload (default: true)."},"dry_run":{"type":"boolean","description":"Validate connectivity/auth only; never uploads or starts a print."}},"required":["gcode_path","protocol","host"]}},{"name":"set_param","description":"Use this when you need to edit a param() default value in a kernelCAD script. Returns the modified code as text plus diagnostics from re-evaluating the result. Caller persists the new code via standard file-write tools (this tool has no side effects).","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"param_name":{"type":"string","description":"The string literal name of the param (first arg to param())."},"new_value":{"oneOf":[{"type":"number"},{"type":"string"}],"description":"The new default value. Either a number for a numeric param (e.g. 12.5), or a string expression evaluated in the script (e.g. \"width/2 + 3\").","examples":[12.5,"width/2 + 3"]}},"required":["code","param_name","new_value"]}},{"name":"set_scene_return","description":"Use this when you need to set how the script returns its assembly. Replace the final top-level return statement with `return <assembly>.model();` or `return <assembly>.solvedModel(poses, options?);`. Use solvedModel for mate-authored mechanisms so FK and validation run. Returns modified source plus diagnostics from re-evaluation.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"code":{"type":"string","description":"The .kcad.ts source code."},"assembly_binding":{"type":"string","description":"JS identifier bound to assembly(...)."},"mode":{"type":"string","enum":["model","solvedModel"]},"poses":{"type":"object","description":"Optional solvedModel pose overrides keyed by mate name. Defaults to {}."},"options":{"type":"object","description":"Optional solvedModel options such as { validate: 'warn', posesGate: 'envelope' }."}},"required":["code","assembly_binding","mode"]}},{"name":"solve_mates","description":"Use this when you need to solve the mate graph and get part poses. Run the v0.6 mate-graph solver on the active assembly. Returns { status, poses, iterations? } where each pose is a serialized Transform ({ translation, rotateAxis, rotateDeg }). Optional poses overrides mate pose values by mate name.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"assembly":{"type":"string"},"poses":{"type":"object","description":"Optional numeric pose overrides keyed by mate name."}}}},{"name":"solve_sketch","description":"Use this when you need to solve a 2D sketch constraint set. Solve a 2D sketch constraint set. Side-effect-free: pass { entities, constraints } and receive solved entities plus the original constraints. Entities are POINT, LINE, and CIRCLE records; constraints use the kernelCAD constraint vocabulary.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"entities":{"type":"array","description":"Sketch entities to solve. Lines reference point ids; circles reference a center point id.","items":{"oneOf":[{"type":"object","description":"POINT — a 2D point.","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["POINT"]},"x":{"type":"number"},"y":{"type":"number"},"fixed":{"type":"boolean","description":"If true, the solver won't move this point."}},"required":["id","type","x","y"]},{"type":"object","description":"LINE — references two point ids.","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["LINE"]},"p1":{"type":"string"},"p2":{"type":"string"}},"required":["id","type","p1","p2"]},{"type":"object","description":"CIRCLE — references a center point id.","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["CIRCLE"]},"center":{"type":"string"},"radius":{"type":"number"}},"required":["id","type","center","radius"]}]}},"constraints":{"type":"array","description":"Constraints to apply to the entities.","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["COINCIDENT","DISTANCE","HORIZONTAL","VERTICAL","PARALLEL","PERPENDICULAR","EQUAL_LENGTH","TANGENT","RADIUS","ANGLE","CONCENTRIC","SYMMETRIC"]},"entities":{"type":"array","items":{"type":"string"},"description":"Ids of the entities the constraint relates."},"value":{"type":"number","description":"Required for DISTANCE, RADIUS, and ANGLE."}},"required":["id","type","entities"]}}},"required":["entities","constraints"]}},{"name":"sweep_tolerance","description":"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.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string","description":"Path to a .kcad.ts script file."},"code":{"type":"string","description":"Inline kernelCAD script source."},"assembly":{"type":"string","description":"Assembly name; defaults to the first captured assembly."},"params":{"type":"object","description":"param() name -> { values: [number|string, ...] } or { min, max, steps }."},"gates":{"type":"object","description":"Which standard gates to run per combo.","properties":{"interference":{"type":"boolean","description":"Default true."},"mountingHoles":{"type":"boolean","description":"Default true."},"jointAxis":{"type":"boolean","description":"Default true."},"reachable":{"type":"object","description":"Runs the reachability gate when set.","properties":{"tipLink":{"type":"string"},"targetPosition":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3},"targetOrientation":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3}},"required":["tipLink","targetPosition"]}}}},"required":["params"]}},{"name":"trace_from_image","description":"Use this when you need to trace features from a reference photo into waypoints. Trace pixel-space features from a reference photo into normalized [0..1] waypoints the agent can map to mm via a known scale anchor and feed to path().spline / path().nurbsSegment. Three backends are dispatched behind the scenes: `opencv` (deterministic; uniform-bg silhouette only), `vision-llm` (Claude vision; named points/cluttered backgrounds; caller-supplied ANTHROPIC_API_KEY), and `hybrid` (opencv silhouette + LLM-labeled named points). Default backend is `auto` — the tool picks based on the image's corner-color stddev. Accuracy honesty: opencv contour is geometrically exact; vision-LLM is typically 5–10% off on dense landmarks. Per-feature `confidence` is reported. Caller pays for any vision-LLM API spend via their own ANTHROPIC_API_KEY. Pair with the `kernelcad-trace-from-image` skill for the conversion-to-mm pipeline.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"imageUrl":{"type":"string","description":"URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path."},"hint":{"type":"string","description":"Optional free-text hint forwarded to vision-LLM backends (e.g. \"a pair of eyewear; trace the upper brow only\")."},"features":{"type":"array","description":"Features to trace. Defaults to a single { label: \"silhouette\", kind: \"silhouette\" } when omitted.","items":{"type":"object","properties":{"label":{"type":"string","description":"Caller-chosen identifier (echoed in the response)."},"kind":{"type":"string","enum":["silhouette","curve","point","bbox"],"description":"Geometric shape of the requested feature."},"region":{"type":"string","description":"Optional free-text region hint forwarded to vision-LLM backends; ignored by opencv."}},"required":["label","kind"]}},"maxWaypointsPerFeature":{"type":"integer","description":"Cap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines).","minimum":2},"backend":{"type":"string","enum":["opencv","vision-llm","hybrid","auto"],"description":"Force a specific backend; default `auto` routes by corner-color stddev."},"scaleAnchor":{"type":"object","description":"Pixel-to-real-world scale anchor: two measured points on the image. Absent -> the returned ledger's `scale` fact is `missing`.","properties":{"pixelDistance":{"type":"number","description":"Distance in pixels between the two measured points."},"realDistance":{"type":"number","description":"The same distance in real-world units."},"unit":{"type":"string","enum":["mm","cm","in"]}},"required":["pixelDistance","realDistance","unit"]},"priors":{"type":"array","description":"Caller-supplied category-norm defaults (e.g. wall thickness) recorded verbatim as `assumed` ledger facts.","items":{"type":"object","properties":{"id":{"type":"string"},"statement":{"type":"string"},"value":{},"confidence":{"type":"number","minimum":0,"maximum":1}},"required":["id","statement","value","confidence"]}},"validate":{"type":"string","enum":["warn","error"],"description":"Assumption-ledger strictness. `warn` (default) never blocks. `error` fails the call when any `missing` ledger fact (e.g. scale) is still open."}},"required":["imageUrl"]}},{"name":"verify","description":"Use this when you need to check a design against a rule set. One verifier, selected by `check`:\n- 'assembly' — mate-aware assembly validator on the active session (run evaluate_script first).\n- 'urdf' — structural validity of a .urdf file ({ urdf_path }).\n- 'dfm' — print-readiness gates declared by dfmSpec() ({ file | code }).\n- 'dfm-preflight' — sheet-metal flat pattern vs a job-shop's ordering rules ({ vendor, material, thicknessIn|thicknessMm, ... }).\n- 'swept-collision' — sweep declared joint range(s) and report colliding poses.\n- 'reachable' — inverse-kinematics reachability for an end-effector ({ tip_link, target_position, ... }).\n- 'mounting-holes' — fastened mates expose matching hole diameters on both sides.\n- 'load-capacity' — closed-form Euler-Bernoulli beam stress / safety-factor check ({ loads, materials, ... }).\n- 'static-hold' — gravitational holding torque/force at a sampled pose grid vs each actuated joint's declared actuator capacity ({ joint?, pose?, gravity?, min_torque_margin_pct?, range_samples? }).\n- 'body-likeness' — publish gate for organic/car bodies: cheap AABB↔wheel checks plus required agent still verdicts (side-body-over-wheels, side-cabin-aft, rear-haunch, ortho-proportions-vs-reference). Pass { body_bbox | code/file+body_feature_id, wheels?, cabin_bbox?, still_verdicts?, require_stills? }. Full CV silhouette matching is NOT implemented — agents must inspect ortho PNGs/Studio and supply still_verdicts before claiming success.\nAll params except `check` are check-specific and forwarded verbatim; each check fails closed on its own missing required params.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"check":{"type":"string","enum":["assembly","urdf","dfm","dfm-preflight","swept-collision","reachable","mounting-holes","load-capacity","static-hold","body-likeness"],"description":"Which verification to run."},"file":{"type":"string","description":"Path to a .kcad.ts script (assembly/dfm/dfm-preflight/swept-collision/reachable/mounting-holes/load-capacity/static-hold)."},"code":{"type":"string","description":"Inline kernelCAD script source (same checks as `file`)."},"assembly":{"type":"string","description":"Assembly name; defaults to the first captured assembly."},"urdf_path":{"type":"string","description":"check:'urdf' — path to the .urdf file."},"dxf":{"type":"string","description":"check:'dfm-preflight' — path to a DXF file."},"featureId":{"type":"string","description":"check:'dfm-preflight' — FeatureId to scope to."},"vendor":{"type":"string","description":"check:'dfm-preflight' — vendor SKU (required for that check)."},"material":{"type":"string","description":"check:'dfm-preflight' — material SKU (required for that check)."},"thicknessIn":{"type":"number","description":"check:'dfm-preflight' — material thickness in inches."},"thicknessMm":{"type":"number","description":"check:'dfm-preflight' — material thickness in millimeters."},"service":{"type":"string","enum":["laser","cnc-router","waterjet","bending"],"description":"check:'dfm-preflight' — service."},"refreshCatalog":{"type":"boolean","description":"check:'dfm-preflight' — force vendor catalog refresh."},"joint":{"type":"string","description":"check:'swept-collision' — joint to sweep; omit to sweep every declared joint. check:'static-hold' — joint to evaluate; omit to evaluate every joint with a declared actuator."},"range":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"check:'swept-collision' — [lower, upper, step] in joint-native units."},"collision_tolerance_mm3":{"type":"number","description":"check:'swept-collision' — BREP intersection volume tolerance (mm^3)."},"tip_link":{"type":"string","description":"check:'reachable' — end-effector part name (required for that check)."},"target_position":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"check:'reachable' — target [x, y, z] mm (world frame)."},"target_orientation":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"check:'reachable' — target XYZ Euler angles in radians."},"position_tolerance_mm":{"type":"number","description":"check:'reachable' — position tolerance in mm."},"orientation_tolerance_rad":{"type":"number","description":"check:'reachable' — orientation tolerance in radians."},"prefer_solver":{"type":"string","enum":["analytical","numeric","auto"],"description":"check:'reachable' — force the IK path ('auto' default)."},"max_iterations":{"type":"number","description":"check:'reachable' — numeric-path iteration cap."},"seed":{"type":"object","description":"check:'reachable' — numeric IK seed pose (joint name -> deg/mm)."},"loads":{"type":"object","description":"check:'load-capacity' — partName -> { force?: [Fx,Fy,Fz] N, torque?: [Tx,Ty,Tz] N*m }."},"materials":{"type":"object","description":"check:'load-capacity' — partName -> material declaration."},"mode":{"type":"string","enum":["stub","beam"],"description":"check:'load-capacity' — 'beam' (default) or 'stub'."},"safety_factor_threshold":{"type":"number","description":"check:'load-capacity' — pass/fail safety-factor floor (default 1.5)."},"pose":{"description":"check:'static-hold' — explicit pose (joint name -> deg/mm) or array of poses; omit to sample a grid across the evaluated joint's range."},"gravity":{"type":"array","items":{"type":"number"},"minItems":3,"maxItems":3,"description":"check:'static-hold' — gravity vector, m/s^2, world frame (default [0, 0, -9.81])."},"min_torque_margin_pct":{"type":"number","description":"check:'static-hold' — safety-margin floor as a percent of actuator capacity (default 20)."},"range_samples":{"type":"number","description":"check:'static-hold' — grid density per evaluated joint when `pose` is omitted (default 9)."},"body_bbox":{"type":"object","description":"check:'body-likeness' — body AABB { min:[x,y,z], max:[x,y,z] } in mm."},"body_feature_id":{"type":"string","description":"check:'body-likeness' — FeatureId to read body AABB from when body_bbox omitted."},"cabin_bbox":{"type":"object","description":"check:'body-likeness' — optional cabin/greenhouse AABB for automated cabin-aft."},"wheels":{"type":"array","description":"check:'body-likeness' — wheel centres + tire radii [{ center:[x,y,z], radius }].","items":{"type":"object"}},"length_axis":{"type":"string","enum":["x","y"],"description":"check:'body-likeness' — wheelbase axis (default 'x')."},"still_verdicts":{"type":"array","description":"check:'body-likeness' — agent ortho still checklist [{ code, passed, finding, view? }]. Required codes: side-body-over-wheels, side-cabin-aft, rear-haunch, ortho-proportions-vs-reference.","items":{"type":"object"}},"require_stills":{"type":"boolean","description":"check:'body-likeness' — require still_verdicts (default true)."}},"required":["check"]}},{"name":"why_did_this_fail","description":"Use this when you need to trace why a feature failed. Walk the upstream chain of a failing feature. Returns the diagnostics of the requested feature plus the diagnostics of every upstream feature in topological order (the requested feature is the last entry). Per-code hints are inline on every diagnostic — call lookup_diagnostics for the full catalogue. Pass { file?, code?, feature_id? }.","write_action":false,"price_micros":0,"input_schema":{"type":"object","properties":{"file":{"type":"string"},"code":{"type":"string"},"feature_id":{"type":"string"}}}}],"scan":{"score":78,"grade":"B","scanned_at":"2026-09-27T12:16:37.621Z","report":{"scannerVersion":"0.1.9","scannedAt":"2026-09-27T12:16:37.591Z","components":{"code":{"score":25,"max":25,"notes":["1 source files scanned"]},"reliability":{"score":17,"max":20,"notes":["remote reachable in 2143ms"]},"poisoning":{"score":13,"max":15,"notes":["54 tool descriptions checked"]},"auth":{"score":3,"max":15,"notes":["open endpoint exposes 3 write-action tools with no auth"]},"maintenance":{"score":15,"max":15,"notes":["last push 2 days ago"]},"identity":{"score":5,"max":10,"notes":["namespace and repository owner differ","GitHub account older than a year"]}},"findings":[{"id":"auth.open-write","severity":"high","component":"auth","title":"Write-action tools reachable without authentication"},{"id":"poison.long-description","severity":"low","component":"poisoning","title":"Unusually long tool description (over 2,000 characters)","evidence":"tool open_in_studio: …Save/publish the current kernelCAD model AND display it in one step: persists the project, returns the interactive Studio viewer (MCP Apps / ChatGPT outputTemplate), and includes a PNG preview in the SAME tool result (image content + previewUrl when available). Use this when the user wants to SEE or share the model — do NOT call get_latest_render afterwards for the happy path; the preview is already here when previewDelivered is true. Pass the full `.kcad` source as `code` (optional if you just called evaluate_script — omitting reuses that last evaluated source). Multi-body assemblies must declare connectors + mates/joints before publish — otherwise evaluate_script fails with mechanism.orphan-part (disconnected components). Use type: 'axis' + revolute mates for shafts/hinges/gears; type: 'frame' + fastened for rigid mounts; or arm.revolute/.prismatic/.ball/.fixed. Connector types are only frame|axis|planar|ball. Pass `slug` from a previous call to update the same project in place; omit `slug` only for a new separate model. Status fields: ok=true means publish succeeded (under CDN, meshStatus ready/building; ok=false + meshStatus=failed means hard mesh persist failure — do not claim the viewer is ready). previewDelivered=true means this result carries a displayable PNG — only then may you tell the user a preview was shown. meshStatus mirrors get_project (ready|building|failed|missing). Under CDN, open_in_studio waits up to ~20s (OPEN_IN_STUDIO_MESH_SYNC_BUDGET_MS) for the revision mesh before returning; heavier publishes usually land meshStatus=ready. If still meshStatus=building + meshReady=false: TRANSIENT — meshUrl is the expected CDN pin; embed retries 404s. Poll get_project({slug}) until ready, or re-call open_in_studio with same code+slug — never treat building as permanent failure/404. ALWAYS pass `code` when you have it (avoid no_code_to_reuse); evaluate_script reuse is a fallback. Paint phases: projectSaved / meshReady / previewDelivered are set here; viewerPainted is ONLY true after widget ack (model context / widgetState) — never claim paint from this tool alone. Do NOT call get_model_mesh or get_latest_render for interactive paint. Pass include_preview:false to skip the rasterizer (save + viewer URLs only). Trigger phrases: \"open it in Studio\", \"let me see it\", \"show me the model\"; also call after you finish a build and after each meaningful revision while iterating. ORGANIC/CAR SUCCESS GATE: for final likeness claims pass likeness_profile:\"automotive\" (and body_bbox/wheels/still_verdicts, or a prior verify body-likeness pass for this code). If the gate fails, ok:false with DX reference.likeness.publish-blocked|gate-required — do not claim success. Omit likeness_profile for WIP previews only.…"}],"inputs":{"probes":[{"url":"https://mcp.kernelcad.com/mcp","reachable":true,"authRequired":false,"latencyMs":2143,"serverInfo":{"name":"kernelcad","version":"1.0.0"}}],"packages":[{"registryType":"npm","identifier":"kernelcad","version":"0.11.2","found":true,"hasInstallScripts":false,"dependencyCount":31,"publishedAt":"2026-06-02T15:50:32.636Z","weeklyDownloads":120}],"repo":{"found":true,"owner":"w1ne","repo":"kernelCAD-web","archived":false,"pushedAt":"2026-09-25T01:01:54Z","stars":25,"forks":3,"openIssues":2,"ownerType":"User","ownerAvatarUrl":"https://avatars.githubusercontent.com/u/14119286?v=4","ownerCreatedAt":"2015-09-04T01:54:16Z","license":"MIT"},"icon":{"url":"https://app.kernelcad.com/favicon.svg","source":"site"},"presence":{"stars":25,"forks":3,"downloadsWeek":120,"license":"MIT","lastPushAt":"2026-09-25T01:01:54.000Z","score":44}}}},"grade_history":[],"reviews":[]}