accueil / serveurs / Données & BDD / com.kernelcad/kernelcad
com.kernelcad/kernelcad
serveur MCP (Model Context Protocol) · kernelcad 1.0.0
Référencé dans l'annuaire. Seul le pentest comportemental fait foi, et il n'a pas encore été exécuté sur ce serveur.
Est-ce que com.kernelcad/kernelcad est sûr ?
Au dernier audit MCP Hub, le serveur MCP « com.kernelcad/kernelcad » est classé « Non encore testé ». Référencé dans l'annuaire. Seul le pentest comportemental fait foi, et il n'a pas encore été exécuté sur ce serveur. Le verdict est réévalué en continu ; consultez la fiche pour l'état à jour.
Méthode : MCP Hub analyse la description de chaque outil (couche 1) et, pour le verdict fort, exécute le serveur dans une micro-VM isolée avec leurres et réseau bloqué (couche 2). On publie des noms et des compteurs, jamais le contenu brut renvoyé par un outil.
Les 73 outils
- add_connector≈ 507 tokens
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.
Paramètres, retour & exemple (7)
Paramètresaxis· array · optionnel
Optional [x, y, z] axis.code· string · requis
The .kcad.ts source code.name· string · requis
Connector name unique within the part.type· string · requis · frame | axis | planar | ballnormal· array · optionnel
Optional [x, y, z] normal.origin· ? · requis
Origin as [x, y, z] shorthand, or a structured ConnectorOrigin.part_binding· string · requis
JS identifier bound to an AssemblyPartRef, e.g. "basePart".
Exemple d'appel{"name": "add_connector", "arguments": {"code": "texte", "name": "texte", "type": "frame", "origin": "texte", "part_binding": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_constraint≈ 402 tokens
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.
Paramètres, retour & exemple (2)
Paramètresconstraint· object · requis
The constraint to append.constraints· array · optionnel
Existing constraint list to append to (omit for an empty list).
Exemple d'appel{"name": "add_constraint", "arguments": {"constraint": {}}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_curve≈ 980 tokens
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`: - '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`. - '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). The 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.
Paramètres, retour & exemple (10)
Paramètresa· object · optionnel
kind:'hermite' — start endpoint.b· object · optionnel
kind:'hermite' — end endpoint.code· string · requis
The .kcad.ts source code.kind· string · requis · nurbs | hermite
Which curve-construction path to use.knots· array · optionnel
kind:'nurbs' — optional explicit knot vector; missing => clamped-uniform inferred.closed· boolean · optionnel
kind:'nurbs' — optional periodic/closed-curve flag.degree· integer · optionnel
kind:'nurbs' — curve degree; default 3 (cubic).weights· array · optionnel
kind:'nurbs' — optional rational weights, one per control point (same length as controlPoints).binding_name· string · optionnel
JS const name for the new Curve3D binding (default: _curve_<N>).controlPoints· array · optionnel
kind:'nurbs' — control points as Vec3 triples in mm; at least 2 entries.
Exemple d'appel{"name": "add_curve", "arguments": {"code": "texte", "kind": "nurbs"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_feature≈ 266 tokens
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.
Paramètres, retour & exemple (2)
Paramètrescode· string · requis
The .kcad.ts source code.feature_code· string · requis
Single-statement source line to insert (e.g. `const hole = cylinder(5, 2).translate(10, 10, -1);`).
Exemple d'appel{"name": "add_feature", "arguments": {"code": "texte", "feature_code": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_mate≈ 955 tokens
Use this when you need to author a mate-graph relationship into the source, selected by `relation` (default 'mate'): - 'mate' — a typed mate between two connectors ({ name, a, b, type, pose?, limitsDeg?, limitsMm? }). - 'coupling' — couple a driven mate to a source mate by ratio ({ driven, source, ratio, offset? }). - 'transmission' — a physical drive path across mates ({ name, kind, sourceMate, drivenMates, path, ... }). All 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.
Paramètres, retour & exemple (22)
Paramètresa· string · optionnel
relation:'mate' — connector ref "<partName>.<connectorName>".b· string · optionnel
relation:'mate' — connector ref "<partName>.<connectorName>".code· string · requis
The .kcad.ts source code.kind· string · optionnel · direct-horn | link-rod | four-bar | gear-pair | belt | tendon
relation:'transmission' — transmission kind.name· string · optionnel
relation:'mate'|'transmission' — name unique within the assembly.path· array · optionnel
relation:'transmission' — drive path.pose· object · optionnel
relation:'mate' — optional mate pose.type· string · optionnel · fastened | revolute | prismatic | cylindrical | planar | ball | pin_slot
relation:'mate' — mate type.input· string · optionnel
relation:'transmission' — optional input.notes· string · optionnel
relation:'transmission' — optional notes.ratio· number · optionnel
relation:'coupling' — driven pose = source pose * ratio + offset.driven· string · optionnel
relation:'coupling' — driven mate name.offset· number · optionnel
relation:'coupling' — optional pose offset.output· string · optionnel
relation:'transmission' — optional output.source· string · optionnel
relation:'coupling' — source mate name.actuator· string · optionnel
relation:'transmission' — optional actuator.limitsMm· array · optionnel
relation:'mate' — optional [minMm, maxMm].relation· string · optionnel · mate | coupling | transmission
Which relationship to author (default 'mate').limitsDeg· array · optionnel
relation:'mate' — optional [minDeg, maxDeg].sourceMate· string · optionnel
relation:'transmission' — source mate name.drivenMates· array · optionnel
relation:'transmission' — driven mate names.assembly_binding· string · requis
JS identifier bound to assembly(...).
Exemple d'appel{"name": "add_mate", "arguments": {"code": "texte", "assembly_binding": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_part≈ 335 tokens
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.
Paramètres, retour & exemple (6)
Paramètresat· array · optionnel
Optional [x, y, z] assembly placement.code· string · requis
The .kcad.ts source code.part_name· string · requis
Assembly-unique part name.binding_name· string · optionnel
Optional JS const name for the returned AssemblyPartRef. Defaults to a part-name-derived identifier.assembly_binding· string · requis
JS identifier bound to assembly(...), e.g. "arm".shape_expression· string · requis
JS expression for the Shape to pass to assembly.part, inserted verbatim.
Exemple d'appel{"name": "add_part", "arguments": {"code": "texte", "part_name": "texte", "assembly_binding": "texte", "shape_expression": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_path_segment≈ 1348 tokens
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`: - '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). - '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). - '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. Returns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.
Paramètres, retour & exemple (14)
Paramètresa· object · optionnel
kind:'hermite' — start endpoint; point must match current pen position within 1e-6 mm.b· object · optionnel
kind:'hermite' — end endpoint; pen ends at b.point.code· string · requis
The .kcad.ts source code.kind· string · requis · spline | nurbs | hermite
Which path-segment kind to append.knots· array · optionnel
kind:'nurbs' — optional explicit knot vector; length must equal controlPoints.length + degree + 1.degree· integer · optionnel
kind:'nurbs' — B-spline degree (default 3).points· array · optionnel
kind:'spline' — waypoints as Vec2 pairs in mm; at least 2 entries; first must match current pen position.tension· number · optionnel
kind:'spline' — optional Catmull-Rom-style stiffness; forwarded to the underlying B-spline approximation.weights· array · optionnel
kind:'nurbs' — optional rational weights (one per control point; strictly positive).endTangent· array · optionnel
kind:'spline' — optional [x, y] direction vector at points[N-1]. Magnitude is normalised internally; direction matters.binding_name· string · optionnel
Reserved for future use; the segment injection mutates the chain anchor in place.chain_anchor· string · requis
JS identifier of an existing PathBuilder binding (e.g. `const brow = path().moveTo(0,0)`).startTangent· array · optionnel
kind:'spline' — optional [x, y] direction vector at points[0]. Magnitude is normalised internally; direction matters.controlPoints· array · optionnel
kind:'nurbs' — control-net vertices as Vec2 pairs in mm; at least degree+1 entries.
Exemple d'appel{"name": "add_path_segment", "arguments": {"code": "texte", "kind": "spline", "chain_anchor": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_pattern_feature≈ 784 tokens
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.
Paramètres, retour & exemple (7)
Paramètrescode· string · requis
The .kcad.ts source code.grid· object · optionnel
Required when kind=grid.kind· string · requis · linear | circular | gridlinear· object · optionnel
Required when kind=linear.target· string · requis
Variable name of the Shape to pattern (inserted verbatim as the LHS receiver).circular· object · optionnel
Required when kind=circular.assign_to· string · optionnel
Optional const-binding name; emits `const <assign_to> = <target>.patternX(...);`. Omit for statement form.
Exemple d'appel{"name": "add_pattern_feature", "arguments": {"code": "texte", "kind": "linear", "target": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_surface≈ 1751 tokens
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`: - '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. - '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). - '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). - 'sew' — insert a `sew([s0, s1, ...], opts?)` call to stitch N surfaces into a closed watertight solid. 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). - '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. The 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.
Paramètres, retour & exemple (23)
Paramètresop· string · optionnel · trim | split
kind:'trim' — 'trim' discards the smaller half (calls .trimTo()); 'split' retains both halves (calls .split()).code· string · requis
Current .kcad.ts source.face· string · optionnel
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.kind· string · requis · nurbs | boundary | trim | sew | draft
Which surface-construction or surface-finishing path to use: 'nurbs' | 'boundary' | 'trim' | 'sew' | 'draft'.knots· object · optionnel
kind:'nurbs' — optional explicit knot vectors; missing => clamped uniform inferred.degree· object · optionnel
kind:'nurbs' — degrees in U and V; each in [1, nU-1] / [1, nV-1].weights· array · optionnel
kind:'nurbs' — optional rational weights, same grid shape as controls. Ignored in slice-1.controls· array · optionnel
kind:'nurbs' — control-point grid for direct construction (controls[u][v] = [x, y, z], mm).periodic· object · optionnel
kind:'nurbs' — optional periodic flags per parametric direction.pull_dir· array · optionnel
kind:'draft' — demoulding direction as [x, y, z]. Defaults to the face normal at lower time.sampling· integer · optionnel
kind:'boundary' — points sampled along each boundary (default 15).angle_deg· number · optionnel
kind:'draft' — draft angle in degrees [0, 90]. The face is tapered outward by this angle relative to the pull direction.tolerance· number · optionnel
kind:'sew' — edge-merging tolerance in mm (default 1e-6). Edges within this distance are merged.by_binding· string · optionnel
kind:'trim' — JS variable name of the cutter Surface (must be declared in source). Shape/Curve3D cutters are deferred.continuity· ? · optionnel
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'.binding_name· string · optionnel
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>).neutral_plane· string · optionnel
kind:'draft' — parting-line face (the plane where drafted faces remain fixed). Defaults to `face` if omitted.shape_binding· string · optionnel
kind:'draft' — JS variable name of the Shape to taper (must be declared in source).curve_bindings· array · optionnel
kind:'boundary' — tuple of 4 existing Curve3D variable names (bottom, right, top, left) declared earlier in the source.require_closed· boolean · optionnel
kind:'sew' — when true the lowerer emits feature.surface-sew.open-shell if the stitched result is not a watertight solid.surface_binding· string · optionnel
kind:'trim' — JS variable name of the Surface to trim/split (must be declared in source).surface_bindings· array · optionnel
kind:'sew' — JS variable names of the surfaces to stitch into a solid (each must be declared in source).section_sketch_ids· array · optionnel
kind:'nurbs' — existing sketch FeatureIds (2 or more) to skin a surface through, in order.
Exemple d'appel{"name": "add_surface", "arguments": {"code": "texte", "kind": "nurbs"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_text≈ 886 tokens
Use this when you need to author text into a kernelCAD script before the last top-level return. One authoring path, selected by `mode`: - '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. - '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. Default 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.
Paramètres, retour & exemple (17)
Paramètrescode· string · requis
The .kcad.ts source code.face· string · optionnel
mode:'emboss' — target face — canonical name ('top'/'bottom'/'left'/'right'/'front'/'back') or label.font· string · optionnel
mode:'sketch' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans.mode· string · requis · sketch | emboss
Which text-authoring path to use.size· number · optionnel
mode:'sketch'|'emboss' — glyph cap height in mm (positive finite).align· string · optionnel · left | center | right
mode:'sketch' — horizontal alignment relative to position (default left); mode:'emboss' — relative to the UV anchor (default center).depth· number · optionnel
mode:'emboss' — signed extrusion depth in mm: positive emboss out, negative engrave in. Must be non-zero.bindAs· string · optionnel
mode:'sketch' — emits `const <bindAs> = sketch.text(...)`; mode:'emboss' — emits `const <bindAs> = <target>.embossText(...);`.target· string · optionnel
mode:'emboss' — variable name of the Shape to chain onto (inserted verbatim).anchorU· number · optionnel
mode:'emboss' — U anchor in [0, 1] face-local (0=umin, 0.5=centre, 1=umax). Default 0.5.anchorV· number · optionnel
mode:'emboss' — V anchor in [0, 1] face-local. Default 0.5.content· string · optionnel
mode:'sketch' — text content (UTF-8, non-empty, non-whitespace).position· array · optionnel
mode:'sketch' — [x, y] anchor in mm. Default [0, 0].rotation· number · optionnel
mode:'sketch' — CCW rotation in degrees around position (default 0); mode:'emboss' — CCW rotation in the face tangent plane (default 0).scaleMode· string · optionnel · original | native | bounds
mode:'emboss' — Drawing.sketchOnFace scaling mode. Default original.fontFamily· string · optionnel
mode:'emboss' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans.textContent· string · optionnel
mode:'emboss' — text content (UTF-8, non-empty, non-whitespace).
Exemple d'appel{"name": "add_text", "arguments": {"code": "texte", "mode": "sketch"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_variable_sweep≈ 867 tokens
Use this when you need an organic swept solid whose cross-section changes along its length — a tapering body, horn, bottle, handle, ring band, fairing, or duct — authored as a variable-section sweep along a spine. Inserts `variableSweep(spine, sections, opts?)` into the .kcad.ts `code` immediately before the last top-level return (an empty `code` starts a new script that returns the sweep). Spine: EITHER `spine_points` ([[x,y,z], ...] in mm, interpolated with spline3d; `spine_closed: true` closes the loop for a ring) OR `spine_binding` (an existing Curve3D / Sketch / Vec3[] variable). Each section: `t` in [0, 1] plus a profile — inline `radius` (circle) or `width` + `height` (rectangle), or `profile_binding` (an existing Sketch); profiles are centred on the spine and turned to face along it. Sections are strictly increasing in t, first t=0, last t=1 (omit t on every section to space them evenly). On a closed spine t=1 is the seam and reuses the t=0 profile. Example: { code, spine_points: [[0,0,0],[0,10,30],[0,0,60]], sections: [{ t: 0, radius: 8 }, { t: 0.5, radius: 10 }, { t: 1, radius: 4 }] }. Returns the modified code, diagnostics from re-evaluating it, and `sweep` { volumeMm3, bbox } measured from the built solid (ok:false when the sweep built nothing). The result is a Shape binding: return it, or chain `.union(...)` etc. via add_feature. Orientation is not exposed by this MCP tool until runtime orientation support is wired. Side-effect-free.
Paramètres, retour & exemple (8)
Paramètrescode· string · requis
The .kcad.ts source code ("" for a new script).closed· boolean · optionnel
Optional closed-sweep flag.sections· array · requis
Varying cross-sections along the spine; at least 2 entries, strictly increasing in `t`, first t=0, last t=1.continuity· string · optionnel · C0 | C1 | C2
Inter-section continuity; default 'C1'.binding_name· string · optionnel
JS const name for the new Shape binding (default: _sweep_<N>).spine_closed· boolean · optionnel
With spine_points: close the spline into a loop (ring band, loop handle).spine_points· array · optionnel
Inline spine: at least 2 [x, y, z] points in mm, interpolated with spline3d. Use this OR spine_binding.spine_binding· string · optionnel
Existing variable name for a Curve3D / Sketch / Vec3[] declared earlier in the source. Use this OR spine_points.
Exemple d'appel{"name": "add_variable_sweep", "arguments": {"code": "texte", "sections": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - add_workspace_target≈ 322 tokens
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.
Paramètres, retour & exemple (5)
Paramètrescode· string · requis
The .kcad.ts source code.reachable· array · requis
World-frame Vec3 targets the connector must be able to reach.toleranceMm· number · optionnel
Optional non-negative tolerance in mm.connector_ref· string · requis
Connector ref "<partName>.<connectorName>".assembly_binding· string · requis
JS identifier bound to assembly(...).
Exemple d'appel{"name": "add_workspace_target", "arguments": {"code": "texte", "reachable": [], "connector_ref": "texte", "assembly_binding": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - apply_surface_blend≈ 512 tokens
Use this when you need to author and evaluate a fillet or chamfer on a kernelCAD Shape. Inserts Shape.fillet(radius, selector, { continuity: G1|G2 }) or Shape.chamfer(distance, selector) through the existing public API and returns the patched source plus evaluation diagnostics. Selectors accept EdgeSelector syntax, including canonical edge refs/query strings or { face: canonical name, face label, or face query }. G2 continuity applies to fillets; chamfer uses the existing chamfer API. This authors the operation and does not extract blend-surface NURBS poles; that still requires kernel surface extraction.
Paramètres, retour & exemple (7)
Paramètrescode· string · requis
Inline .kcad.ts source.radius· number · optionnel
Fillet radius in mm; required for operation:'fillet'.distance· number · optionnel
Chamfer distance in mm; required for operation:'chamfer'.selector· ? · optionnel
Optional EdgeSelector: a canonical @kc[...] edge ref/query string or { face: canonical face name, face label, or FaceQuery descriptor }. Omit to select all sharp edges.operation· string · optionnel · fillet | chamfer
Operation; defaults to 'fillet'.continuity· string · optionnel · G1 | G2
Fillet continuity passed to the existing public API; defaults to G1. Chamfer ignores this field.shape_binding· string · requis
Existing Shape variable name to blend.
Exemple d'appel{"name": "apply_surface_blend", "arguments": {"code": "texte", "shape_binding": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - capture_animation≈ 1439 tokens
Use this when you need to render a script's animation timeline to a video, or a 360° turntable of a model for sharing. 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. TURNTABLE MODE: pass { turntable: true } for a seamless 360° orbit of the model (no animationView record needed) — a share-ready loop for a README, social post or product page. It uses the 'publish' studio look by default (same as render_preview preset: 'publish': key/fill/rim lights, soft contact shadow, clean backdrop, 30° lens, constant auto-framing over the whole orbit, light rig turns with the camera); { preset: 'default' } keeps the engineering look. Knobs: width/height (default 1080×1080, max 2048, even for MP4), duration_ms (one revolution, default 6000), fps (default 30), elevation_deg (default 22), background ('white' default, 'light', 'dark', 'black', '#rrggbb', or 'transparent' with frames_dir only), shadow (default true), environment. output_path ending in .gif writes a looping GIF; otherwise MP4. Frame i sits at az 30° + 360°·i/N (the 360° endpoint is excluded, so the loop is seamless). A turntable has no poses to verify: it reports verify_skipped: true. ENVIRONMENT: needs playwright chromium (npx playwright install chromium) and ffmpeg for MP4/GIF (frames_dir needs neither); the bundled static player is served automatically, no dev server required. Returns { ok, output_path, frame_count, duration_ms, fps, verified, verify_skipped?, collisions: [{ t_ms, a, b, volume_mm3 }], diagnostics }.
Paramètres, retour & exemple (17)
Paramètresfps· number · optionnel
Override the animationView record's fps.file· string · requis
Path to a .kcad.ts script with an animationView({...}) record (any script in turntable mode). Required (no inline { code } mode). Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.hide· array · optionnel
Hide matching feature ids / assembly part names in the rendered frames. Mutually exclusive with focus. Render-only; does not affect pose verification.focus· array · optionnel
Show only matching feature ids / assembly part names in the rendered frames. Mutually exclusive with hide. Render-only; does not affect pose verification.width· integer · optionnel
Turntable frame width in px (default 1080; even for MP4).height· integer · optionnel
Turntable frame height in px (default 1080; even for MP4).preset· string · optionnel · default | publish
Turntable look: 'publish' (default; studio product shot) or 'default' (engineering look).shadow· boolean · optionnel
Turntable + publish: soft contact shadow under the model (default true).no_verify· boolean · optionnel
Skip the animation-pose interference verification (default: verify on).turntable· boolean · optionnel
Seamless 360° orbit of the model instead of the animationView timeline.background· string · optionnel
Turntable + publish: 'white' (default), 'light', 'dark', 'black', '#rrggbb', or 'transparent' (frames_dir only — MP4/GIF have no usable alpha).frames_dir· string · optionnel
PNG-sequence mode directory: write frame-0000.png... and skip ffmpeg. Mutually exclusive with output_path.duration_ms· number · optionnel
Turntable: one full revolution in ms (default 6000).environment· string · optionnel
Turntable: HDRI environment override ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse', a URL, or 'none').output_path· string · optionnel
MP4 output path (.gif → looping GIF); default <scriptDir>/<basename>-animation.mp4 (-turntable.mp4 in turntable mode). Mutually exclusive with frames_dir.verify_every· integer · optionnel
Additionally verify at every n-th frame time of the fps schedule (unioned with the keyframe sample set).elevation_deg· number · optionnel
Turntable: camera elevation above the horizon in degrees (default 22).
Exemple d'appel{"name": "capture_animation", "arguments": {"file": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - design_loop≈ 1812 tokens
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. To pick among N alternative candidates for one goal without a judge, pass them all as attempts with consensus:true (geometric medoid selection). 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.
Paramètres, retour & exemple (21)
Paramètresgoal· string · requis
Original user design goal. Fed into every review_cad repair prompt.assembly· string · optionnelattempts· array · requis
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.consensus· boolean · optionnel
Best-of-N by geometric consensus. When true, attempts are N independent candidates for the SAME goal (not a repair sequence): all are reviewed (stopOnPass ignored), all scripts are executed, candidates without a valid solid are dropped, and the candidate whose geometry agrees most with the others (medoid by symmetric Chamfer distance, same model frame) is selected. Ties go to more gates passed, then the shorter script. Returns consensus { chosenIndex, chosenAttemptId, scores, distances, reason }; ok / finalAttemptId / nextActionPrompt describe the selected candidate. Default false.autoRevise· boolean · optionnel
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.epsilonMm3· number · optionnel
Forwarded to review_cad.stopOnPass· boolean · optionnel
Stop after the first attempt that is functional and passes the quality gate. Default true.recordTitle· string · optionnel
Optional title for the build record.bodyLikeness· object · optionnel
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.combinatorial· boolean · optionnel
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.samplesPerMate· integer · optionnel
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.gripperAperture· object · optionnel
Optional gripper aperture request forwarded to review_cad.likenessProfile· string · optionnel · automotive
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).trackConnectors· array · optionnel
Connector refs to track across sampled poses.outputRecordPath· string · optionnel
Optional JSON path to write a Studio-compatible build record.preserveInterfaces· array · optionnel
External mates, connector refs, part names, or behavioral interfaces the agent must preserve between attempts.allowReviewWarnings· array · optionnel
Warning diagnostic codes the original prompt explicitly allows. Other review warnings keep the loop iterating even if review_cad is functionally ok.includeInterference· boolean · optionnel
Forwarded to review_cad. Default true.includePoseEnvelope· boolean · optionnel
Forwarded to review_cad. Default true.requireVisualReview· boolean · optionnel
Require screenshot-backed visualReview with structured checks before accepting an attempt. Default true; set false only for explicit non-visual batch checks.requirePhysicalAcceptance· boolean · optionnel
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(...).
Exemple d'appel{"name": "design_loop", "arguments": {"goal": "texte", "attempts": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - dfm_review≈ 850 tokens
Use this when you need a manufacturability (DFM) report before printing or machining a part: returns a pass/fail checklist, no dfmSpec(...) needed. Pass { file | code } and optional processes (default ['fdm', 'cnc']). FDM 3D printing checks: fdm.overhangs (unsupported overhang steeper than max_overhang_deg, default 45° from vertical), fdm.bridging (bridges over max_bridge_mm, default 10), fdm.min-wall (walls under 2 × nozzle_mm, default 0.4 mm nozzle), fdm.min-hole (holes under 5 × nozzle), fdm.min-pin (warn), fdm.bed-fit (printer profile bed, default generic-fdm), fdm.bed-contact (warn). CNC 3-axis milling checks: cnc.undercuts (surface unreachable from approach_axes, default ['+z']; list several axes for several setups) and cnc.internal-corner-radius (sharp internal corners and fillets smaller than the end-mill radius, tool_diameter_mm default 6). Returns { ok, verdict: 'pass'|'fail', checks: [{ id, process, part, status: 'pass'|'fail'|'warn', summary, value?, limit? }], fdm?, cnc?, diagnostics }. Settings from the script's dfmSpec({ process: 'fdm' }) are used as defaults; call options win. For the script-declared gates (clearance, voids, channels) use verify({ check: 'dfm' }).
Paramètres, retour & exemple (11)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.printer· string · optionnel · generic-fdm | bambu-a1-mini | bambu-a1 | bambu-p1s | bambu-p1p | bambu-x1c | bambu-x1e | bambu-h2d
FDM printer profile id for the bed-fit check. Default 'generic-fdm'.nozzle_mm· number · optionnel
FDM nozzle diameter, mm. Default 0.4.processes· array · optionnel
Processes to review. Default ['fdm', 'cnc'].approach_axes· array · optionnel
CNC tool approach directions, one per setup (the tool comes from that side). Default ['+z'].max_bridge_mm· number · optionnel
FDM longest unsupported bridge, mm. Default 10.build_direction· string · optionnel · +x | -x | +y | -y | +z | -z
FDM part-local axis pointing up from the bed. Default '+z'.max_overhang_deg· number · optionnel
FDM steepest printable overhang, degrees from vertical (0 = wall, 90 = flat ceiling). Default 45.tool_diameter_mm· number · optionnel
CNC end-mill diameter, mm. Default 6.max_undercut_area_mm2· number · optionnel
CNC unreachable area tolerated before cnc.undercuts fails, mm². Default 1.
Exemple d'appel{"name": "dfm_review", "arguments": {"code": "texte", "file": "texte", "printer": "generic-fdm", "nozzle_mm": 1, "processes": [], "approach_axes": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - diff_geometry≈ 820 tokens
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 of the overlap from boolean intersection, 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.
Paramètres, retour & exemple (7)
Paramètrescode· string · optionnel
Revised script — inline source. Mutually exclusive with params.file· string · optionnel
Revised script — path to a .kcad.ts file. Mutually exclusive with params. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.params· object · optionnel
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· boolean · optionnel
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· string · optionnel
Directory for the overlay PNG, its STL inputs, and the generated overlay script. Default: a temp dir.baseCode· string · optionnel
Baseline script — inline source.baseFile· string · optionnel
Baseline script — path to a .kcad.ts file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.
Exemple d'appel{"name": "diff_geometry", "arguments": {"code": "texte", "file": "texte", "params": {}, "render": true, "out_dir": "texte", "baseCode": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - diff_scripts≈ 539 tokens
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; a `return [a, b]` multi-body script diffs per body as "body[0]", "body[1]". An error that still leaves geometry (e.g. a skipped fillet) is listed under base/revised.errors beside the diff. Use after editing a script to verify exactly what changed physically before re-rendering. On a hosted server pass both versions inline: { baseCode: 'return box(10, 10, 10);', code: 'return box(10, 10, 12);' } (base_code/old_code/before and revised_code/new_code/after are accepted as aliases). Read-only — never touches the active session.
Paramètres, retour & exemple (4)
Paramètrescode· string · optionnel
Revised (after) script — inline source. One of file / code is required.file· string · optionnel
Revised (after) script — path to a .kcad.ts file. Local servers only. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.baseCode· string · optionnel
Baseline (before) script — inline source. One of baseFile / baseCode is required.baseFile· string · optionnel
Baseline (before) script — path to a .kcad.ts file. Local servers only. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.
Exemple d'appel{"name": "diff_scripts", "arguments": {"code": "texte", "file": "texte", "baseCode": "texte", "baseFile": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - drawing_to_cad≈ 808 tokens
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. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
Paramètres, retour & exemple (7)
Paramètresout· string · optionnel
Write the emitted script here (a .kcad.ts path); the ledger is written beside it as <stem>.ledger.json.page· integer · optionnel
1-based page to read. Default 1.path· string · optionnel
Path to the drawing PDF on the machine running kernelCAD. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from request_upload — not a path on your machine.intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.verify· boolean · optionnel
Evaluate the rebuilt part and compare it with the drawing. Default true.pdfBase64· string · optionnel
The PDF inline, base64-encoded. Use this instead of `path` against a hosted kernelCAD server.projection· string · optionnel · third-angle | first-angle
Override the projection angle read from the sheet (default: projection symbol or note, else third-angle).
Exemple d'appel{"name": "drawing_to_cad", "arguments": {"out": "texte", "page": 1, "path": "texte", "intent": "texte", "verify": true, "pdfBase64": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - evaluate_script≈ 1244 tokens
Use this when you need to run a script and check it compiles. Full local builds return viewerUrl: a live Studio link reused and updated on later full builds in the same MCP process. Hosted builds return viewerMode: hosted and viewerHint pointing to open_in_studio; they do not start a loopback viewer. Full evaluations return step evidence: build validity, volume and before/after local PNG paths in one shared iso frame. Snapshots require PW_CDP_URL for an existing browser; unavailable captures report an explicit error. Run a kernelCAD .kcad.ts script and report pass/fail + feature count + diagnostics + sceneSummary (BREP validity, volume in mm³, face count, bounding size in mm). 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, as does a mate connector more than 6 mm outside its part bounding box (assembly.mechanical.connector-not-in-solid, the same error review_cad reports) — a mechanism (any mate or joint) needs every part linked by connectors + mates/joints (axis+revolute for shafts/hinges/gears; frame+fastened for rigid; or arm.revolute/.prismatic/.ball/.fixed). A plain multi-part assembly with no mates (base + lid, print layout) is independent bodies and passes. Pass { skipMechanismCheck: true } to opt out (e.g. a deliberately free part next to a mechanism). An animation or drive on a fastened joint (mechanism.motion-on-fixed-joint) is broken: animate a revolute/prismatic mate pose. For a model with moving joints or motion intent, `mechanismSummary.statement` is one plain line: "Motion checked: ..." names what ran; "Motion not checked: ..." is NOT a pass — never call that mechanism working. Every union() is checked too (no opt-out): union.disconnected (the union is several separate solids — a floating operand) and union.member-overlap (two operands that each carry their own .finish()/.material(), the same one, share > 1 mm³ — cut members to fit, e.g. a cross tube between rails is span minus two rail widths) make ok:false. Pass either { file: "<path>" } or { code: "<inline source>" }. Set { dryRun: true } for fast validation while iterating: transpile + capture + capture-light checks without building solids, 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. To show a measurement in the 3D viewer (e.g. hole spacing), declare it in the script with shape.dimension({ kind: "linear", from, to, label }); a full evaluate lists them as dimensions: [{ text, kind, source }], and a shared /p link with ?dims=1 forces them on. Hosted: lib.fromSTEP / fromSTL / fromDXF / fromSVG and referenceImage take a direct string literal or a const bound to one (computed expressions are unsupported). They accept "asset:<id>" (from request_upload), an https:// URL or a data: URI as the path.
Paramètres, retour & exemple (6)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.dryRun· boolean · optionnel
Fast validation only: skip solid build, DFM gates, and meshing. Does not set or clear the active session.intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.kernel· string · optionnel · occt | smlib
Solid-modeling kernel. Default 'occt' (OpenCascade); opt-in 'smlib' uses guarded candidates with explicit OCCT fallback diagnostics.skipMechanismCheck· boolean · optionnel
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.
Exemple d'appel{"name": "evaluate_script", "arguments": {"code": "texte", "file": "texte", "dryRun": true, "intent": "texte", "kernel": "occt", "skipMechanismCheck": true}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - evaluate_sdf≈ 344 tokens
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] }.
Paramètres, retour & exemple (4)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.point· array · requis
Sample point [x, y, z] in mm.fieldName· string · requis
sdf.bind binding name holding the SdfField.
Exemple d'appel{"name": "evaluate_sdf", "arguments": {"point": [], "fieldName": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - execute_cookbook≈ 714 tokens
Use this when you need evaluate_script (and optionally open_in_studio) for an industry / cookbook demo in ONE step — after lookup_cookbook for industry demos, prefer execute_cookbook when you need evaluate+Studio together; empty lookup is not a stop (freehand-author instead). Resolves a cookbook snippet by `id` or BM25 `query` (same ranking as lookup_cookbook), evaluates its body via evaluate_script with bounded vendor timeouts, and returns explicit status with stage resolve|evaluate|open_in_studio. Pass openInStudio:true to publish the same script via open_in_studio after a green full evaluate (hosted MCP). dryRun:true is the fast capture-only path — it is NOT evidence the cookbook builds a solid or is safe to publish; finish with dryRun:false (default) before claiming success or opening Studio.
Paramètres, retour & exemple (9)
Paramètresid· string · optionnel
Cookbook snippet id (e.g. gt2-timing-belt-drive, extrude-rounded-rect-plate).query· string · optionnel
When id is omitted: natural-language query; BM25 picks the top hit (same as lookup_cookbook).dryRun· boolean · optionnel
Default false. dryRun:true is NOT evidence the cookbook builds a solid — capture-only checks; do not claim success or open Studio from a dry run alone.intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.kernel· string · optionnel · occt | smlib
Solid-modeling kernel forwarded to evaluate_script. Default 'occt'; opt-in 'smlib' uses guarded candidates with explicit OCCT fallback diagnostics.project· string · optionnel
Slug of an existing project. Adds a revision to that project. Omit to start a new project when this cookbook or design is different from the one this chat already saved.new_project· boolean · optionnel
Pass true to start a separate project even when this cookbook was already published in this chat.openInStudio· boolean · optionnel
Default false. When true, after a green full (non-dryRun) evaluate, call open_in_studio on the same script (hosted MCP).continue_design· boolean · optionnel
Pass true to add a revision to the design this chat is already saving, even if this call runs a different cookbook. Ignored when `project` is set.
Exemple d'appel{"name": "execute_cookbook", "arguments": {"id": "texte", "query": "texte", "dryRun": true, "intent": "texte", "kernel": "occt", "project": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - explode_view≈ 567 tokens
Use this when you need an ordered exploded-view plan for an assembly. Supply parts as {name,center:[x,y,z],size:[x,y,z]} in mm, or a LabWired handoff containing parts with ref, position_mm.value and physical.bbox_mm (also accepts bbox_mm.value). Optional explicit assembly_order takes precedence over handoff assembly_order / assembly.order. Missing order falls back to input part order; parts lacking usable placement or bbox and unlisted/unknown order refs are reported. Choose mode axis (default) or radial; axis follows the requested direction, radial moves parts away from the assembly centroid. The result includes ready-to-paste param_declarations, animation_tracks and reverse_animation_tracks for animationView(), part_transforms for existing shapes, and script_fragment. cameraPlan gives framing guidance.
Paramètres, retour & exemple (7)
Paramètresaxis· array · optionnel
Assembly direction; default +Z.mode· string · optionnel · axis | radial
Explode direction strategy; default axis.parts· array · optionnel
Named assembly parts and measured bbox centers/sizes in mm. Optional when handoff is supplied.handoff· object · optionnel
Optional handoff metadata. Assembly order lookup supports assembly_order or assembly.order.spacing· number · optionnel
Positive spacing scale; default 1.25.duration_ms· integer · optionnel
Timeline duration from 500 to 60000 ms; default 3000.assembly_order· array · optionnel
Exemple d'appel{"name": "explode_view", "arguments": {"axis": [], "mode": "axis", "parts": [], "handoff": {}, "spacing": 1, "duration_ms": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - export≈ 3994 tokens
Use this when you need to export geometry to a file. One exporter, selected by `target`: - 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 (2D cut file for laser / waterjet / CNC: a flat part — plate, panel, extruded profile, in any orientation — exports its outline and holes in its own plane with exact arcs and circles; a sheet-metal part or a returned Region exports its flat pattern; a flat or sheet-metal part also returns sheet { thickness_mm, bend_count }, which a shop needs and the DXF does not carry; options.section { axis: "x"|"y"|"z", at } exports the cross-section of any part in world coordinates (plans, profiles); a multi-part model (cut list) writes all parts side by side on output_path, one layer per part, plus parts/<part>.dxf per part (reported in part_files; options.layout 'sheet' writes the combined sheet only); any other part fails with export.dxf.non-planar), 3mf (slicer-friendly mesh: one named object per part, colours as core-spec basematerials named by the part's engineering material; options.arrange 'plate' packs parts on the bed at Z=0 without overlap (options.orient puts each part's largest flat face down), 'assembled' keeps them together as one multi-part object for multi-colour prints; options.slicer 'bambu' | 'orca' | 'prusa' adds that slicer's per-object name + filament-slot sidecar — slot N is the Nth distinct colour/material), options.infill { fromFea: '<study>' | true, bands?, pattern? } = stress-graded FDM infill (requires the local CalculiX + gmsh toolchain; without it the export fails with fea.solver.unavailable): solves the feaStudy and writes modifier volumes, each with its own infill density (Orca/Bambu format by default; options.slicer 'prusa' writes PrusaSlicer's format instead, since the two are not interchangeable); the result carries infill { bands, saving, images }), gcode (installed OrcaSlicer output; preserves G-code and returns optional gcode_stats with header generator identity and slicer-predicted time/material), glb (web-viewer / AR with PBR materials), obj (Wavefront indexed triangle mesh), usd (ASCII USDA triangle mesh in millimeter, Z-up coordinates; multi-part scenes emit one named mesh per part), 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). pdf-drawing (the same sheet — views, dashed hidden lines, dimensions, hole callouts, GD&T, sections, parts list — as a printable vector PDF on a standard sheet, one call: ISO a4|a3|a2|a1|a0 or ANSI ansi-a…ansi-e landscape, default a3, or sheet "auto" / "auto-ansi" for the smallest sheet that holds the views at 1:1; the drawing scale is picked to fit; projection "third" (default) or "first" arranges the views and draws the matching symbol; a full title block carries title, part name, material, scale, units, sheet size, date and revision, settable through options.title / partName / material / revision / date; autoAnnotate is on unless options.annotations is given). 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, fabrication process (`process` + `processSource`), and catalog provenance for purchased parts; same numbers as inspect({ of: 'bom' })). order-pack (a zip: one single-body file per fabricated part — STEP always, plus STL for 3d-print and DXF for sheet-cut rows, per-part drawing PDFs where available — with bom.csv/bom.json, vendor paste handoff texts for purchased rows and a machine-readable manifest; options processes / items narrow which rows are packed; nothing is uploaded). bend-table (tube bender tables over tube() records: one <tube name>.csv per tube with the LRA bend table, XYZ points, cut length and last straight; output_path is a DIRECTORY and the written files are reported in table_files; a script with no tube() fails with export.bend-table.no-tubes, and a script whose tube gates report errors writes nothing). 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/section/layout, 3mf printUnit/embedSource/arrange/orient/slicer/printer/infill, glb axis/draco). - 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. Pass { 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. Hosted server: the file is written on the kernelCAD server, NOT on the caller's machine. The result carries `downloads[]` — an HTTPS `url` per file (expires after 24 h; give it to the user) — Small text files an agent can read (SVG, DXF, URDF, JSON, CSV; up to 32 KB) also come inline as an embedded resource; STEP, STL, 3MF and GLB are link-only — do not fetch them into your context, give the user the link. `output_path` only names the file; the returned `output_path` is a server-side path, usable only as `file` in later calls to this server. HEAVY FORMATS (step/stl/3mf/glb): if OCCT serialization outlives the client tool-call limit, this tool returns { ok:true, status:"running", code:"export.deferred", job_id } while the export continues on the server — poll by calling export({ job_id }) until status is done/failed. CRITICAL: open_in_studio / paint does NOT need STEP. On export.deferred or any STEP stall, call open_in_studio immediately for the shaded widget; do not block paint on export.
Paramètres, retour & exemple (11)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.part· string · optionnel
target:'part' — part name for single-part export, or 'all'.format· string · optionnel · stl | step | dxf | 3mf | glb | obj | usd | svg-drawing
target:'model' — output file format (required for that target).intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.target· string · requis · model | part
Which exporter to run: 'model' (whole-script geometry to one file) or 'part' (per-part STLs from a solved assembly).options· object · optionnel
target:'model' — optional per-format options bag. Discriminator options.format must equal top-level format. dxf: { layers?, unit?: "mm"|"cm"|"in", tolerance?, section?: { axis: "x"|"y"|"z", at: mm }, layout?: "per-part"|"sheet" }. 3mf: { printUnit?: "mm"|"cm"|"in", embedSource?, arrange?: "none"|"plate"|"assembled", orient?: boolean, slicer?: "generic"|"bambu"|"orca"|"prusa", printer?: printer profile id, one of "generic-fdm"|"bambu-a1-mini"|"bambu-a1"|"bambu-p1s"|"bambu-p1p"|"bambu-x1c"|"bambu-x1e"|"bambu-h2d"|"bambu-h2s"|"prusa-mini-plus"|"prusa-mk4s"|"prusa-core-one"|"prusa-xl"|"creality-ender-3-v3"|"creality-k1"|"creality-k1-max"|"creality-k2-plus"|"elegoo-neptune-4-pro"|"anycubic-kobra-3"|"voron-2.4-250"|"voron-2.4-300"|"voron-2.4-350"|"ultimaker-s5" (default "generic-fdm"; sets the bed for arrange and the slicer default; an unknown id is refused with the valid list; CLI: kernelcad print printers) }; parts that do not fit the bed are still written and reported as warn diagnostics export.3mf.plate-overflow / export.3mf.exceeds-bed, whose hint names the smallest profiles the layout fits on. gcode: { printer?: printer profile id, layerHeight?: mm, infill?: percent, supports?: boolean, material?: string }; requires a locally installed OrcaSlicer. Returns slicer predictions as gcode_stats; does not start a printer. glb: { axis?: "y-up"|"z-up", draco?: false }. obj and usd are mesh exports with no extra options; usd writes ASCII USDA (millimeter, Z-up). svg-drawing: { views?: ["front"], sheet?: "a4"|"a3" (or any pdf-drawing sheet), projection?, titleBlock?: { title?, partName?, material?, revision? }, modelName?, date?, annotations?, exploded?: { factor, mode? }, balloons?, partsList?, sections?, autoAnnotate? }. views:["front"] produces a centred front-only elevation for SVG or PDF; omit views for four views. Front-only sheets require front annotations and reject isometric balloons/exploded overlays. 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"], dimensioningStyle?: "baseline"|"chain"|"symmetry" }; datums and tolerances declared in the script with shape.datum() / shape.tolerance() override the automatic ones. pdf-drawing: { sheet?: "a4"|"a3"|"a2"|"a1"|"a0"|"ansi-a"|"ansi-b"|"ansi-c"|"ansi-d"|"ansi-e"|"auto"|"auto-ansi" (default "a3"), projection?: "third"|"first", title?, partName?, material?, revision?, date? (default today), modelName?, views?: ["front"], annotations?, sections?, exploded?, balloons?, partsList?, autoAnnotate? (default true unless annotations are given) } — the svg-drawing keys mean the same. Mechanical SVG/PDF also accept draftingProfile?: "general"|"machining"|"sheet-metal" or { id, name, sheet, projection, dimensioningStyle, tolerance?, notes? }, with explicit options overriding profile defaults. Functional drawing review: shape.drawingReview(plan) source declarations merge with reviewPlans?: additional plans; decisionResolutions?: { [encodeURIComponent(planId)+":"+encodeURIComponent(decisionId)]: { note, provenance } }. drawing_report.review reports declared geometric-callout coverage and unresolved engineering decisions. requireCompleteReview?: true rejects incomplete/not-declared mechanical reviews before export; architectural style rejects review contracts. Coverage is not engineering certification. annotationOverrides?: { [drawing_report.annotations[i].id]: { suppress?, text?, view?, offset? } }; offset is extra nonnegative sheet mm. Text edits primary labels while preserving attached FCFs; datum/standalone FCF text is changed in its declaration instead. Suppressed rows remain in the report but not visible counts. Missing IDs warn after geometry edits. Authored annotations can set id for stable review identity. svg-drawing and pdf-drawing also take style?: "mechanical" (default, the part sheet) | "architectural" (a floor plan for a building or room model: section about 1 m above the floor with filled cut walls, wall / opening chain dimensions and overall sizes, room labels with net area, scale bar, north arrow; millimetres, or feet-inches when the model is in whole feet / inches) and plan?: { units?: "metric"|"imperial", cutHeight?: mm above the floor, rooms?: [{ name, at: [x, y] }], northDeg?: degrees clockwise from sheet up }. A building-sized model drawn in the default style gets a drawing.style.architectural-suggested warning.no_verify· boolean · optionnel
Skip the STL watertight verify gate.feature_id· string · optionnel
target:'model' — optional FeatureId to export; defaults to last.output_dir· string · optionnel
target:'part' — destination directory (all-parts mode); files are <dir>/<part>.stl. Hosted server: only the file name is used; the file is written to a server-owned directory and returned as a download link.output_path· string · optionnel
Destination path (a directory for format 'bend-table'). target:'model' — the export file (required). target:'part' — single-part .stl path. Hosted server: only the file name is used; the file is written to a server-owned directory and returned as a download link.
Exemple d'appel{"name": "export", "arguments": {"target": "model"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - fab_pack≈ 758 tokens
Use this when the user wants to get a part made: packages the fabrication files into one directory plus a zip, and returns links to public instant-quote pages. Pass { file | code } and output_dir; optional scope ('part', default — one script's files; 'bom' — the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json and vendor handoff texts), name (default 'part'), formats (default step, stl, 3mf, pdf-drawing, bom-csv; add 'dxf' for flat or sheet parts), and processes ('3d-print' | 'cnc' | 'sheet-cut') to filter the links (bom: also narrows which fabricated rows are packed). Each file is written by the export tool, so its gates apply; a format that fails is reported in files[] and the rest still ship. Also writes manifest.json and README.txt. quote_links lists JLC3DP, JLCCNC, PCBWay, Xometry, SendCutSend and Craftcloud with the pack file to upload to each. One body per file: multi-body files are rejected by every shop. DXF is written only for flat or sheet-metal parts. The McMaster handoff text carries part numbers only, because McMaster quantities are packs and pack sizes are not in the catalog yet. These are plain web pages: nothing is uploaded or ordered. The user opens the link and uploads the file. Run dfm_review first if you have not. Hosted server: pack files are written on the kernelCAD server and returned in downloads[].url; nothing is uploaded to a fabrication service.
Paramètres, retour & exemple (7)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.name· string · optionnel
Base file name (letters, digits, '.', '_', '-'). Default 'part'.scope· string · optionnel · part | bom
Default 'part' (a single-part pack). 'bom' packs the whole assembly's BOM: per-part single-body files, per-part drawings, bom.csv/json, vendor handoff texts, and per-process quote links.formats· array · optionnel
Files to include. Default step, stl, 3mf, pdf-drawing, bom-csv.processes· array · optionnel
Only return quote links for these processes. Default: all.output_dir· string · requis
Directory to write the pack into (created if missing). Hosted server: only the directory name is used; the pack is written in a server-owned directory and returned as download links.
Exemple d'appel{"name": "fab_pack", "arguments": {"output_dir": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - fea_summary≈ 241 tokens
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; run_fea then uses its in-process voxel solver — toolchain.default_solver says which), 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.
Paramètres, retour & exemple (1)
Paramètresoutput_dir· string · optionnel
Directory a previous run_fea wrote to; omit for toolchain status + material table only.
Exemple d'appel{"name": "fea_summary", "arguments": {"output_dir": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - fetch_part≈ 206 tokens
Fetch one bundled catalog part. Prefer `await lib.standard.nema17()` and `await lib.standard.bearing608()` — they are offline and do not download remote STEP. A lookup that cannot finish fails within 45s with errorCode parts.lookup.timeout. Do not retry in parallel.
Paramètres, retour & exemple (6)
Paramètresid· string · optionnelquery· string · optionnelfamily· string · optionnelcategory· string · optionnelstandard· string · optionnelpartsBaseUrl· string · optionnel
Opt-in remote endpoint; no default value ships with kernelCAD.
Exemple d'appel{"name": "fetch_part", "arguments": {"id": "texte", "query": "texte", "family": "texte", "category": "texte", "standard": "texte", "partsBaseUrl": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - fetch_part_model≈ 432 tokens
Use this when a LabWired handoff part needs a STEP or GLB model resolved from a verified HTTPS URL plus SHA-256, or from catalog_id / MPN. The tool uses fetch_part/find_part catalog plumbing, stores URL-fetched bytes in a SHA-256 cache, checks the supplied hash, compares measurable model dimensions with bbox_mm, and returns provenance or a model_not_found result. GLB bounds are checked when POSITION accessor bounds are available; otherwise bbox_check.status is not_checked.
Paramètres, retour & exemple (11)
Paramètresmpn· string · optionnelref· string · optionnelurl· string · optionnel
Direct public HTTPS download URL from the handoff step field.source· string · optionnel
Catalog or manufacturer name, such as KiCad Packages3D.bbox_mm· array · optionnel
Expected [x,y,z] dimensions from the handoff.license· string · optionnel
License string supplied by the source.catalog_id· string · optionnelattribution· string · optionnelpartsBaseUrl· string · optionnel
Optional parts catalog endpoint, passed to find_part/fetch_part.expected_sha256· string · optionnel
Required SHA-256 digest for an explicit URL; catalog hashes are used when resolving catalog records.tolerance_ratio· number · optionnel
Relative expected-versus-measured bbox tolerance, default 0.25.
Exemple d'appel{"name": "fetch_part_model", "arguments": {"mpn": "texte", "ref": "texte", "url": "texte", "source": "texte", "bbox_mm": [], "license": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - find_part≈ 310 tokens
Search the bundled parts catalog (offline). For a NEMA-17 motor write `await lib.standard.nema17()`; for a 608 bearing write `await lib.standard.bearing608()`. Do not fan out parallel lookups and do not pass partsBaseUrl unless you set source:"remote". Remote lookups fail within 45s with errorCode parts.lookup.timeout instead of hanging.
Paramètres, retour & exemple (9)
Paramètrestag· string · optionnellimit· number · optionnelquery· string · optionnelfamily· string · optionnelintent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.source· string · optionnel · local | remote | autocategory· string · optionnelstandard· string · optionnelpartsBaseUrl· string · optionnel
Opt-in remote endpoint; no default value ships with kernelCAD.
Exemple d'appel{"name": "find_part", "arguments": {"tag": "texte", "limit": 1, "query": "texte", "family": "texte", "intent": "texte", "source": "local"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - fit_plane≈ 239 tokens
Use this when you need to fit an orthogonal least-squares plane to XYZ point-cloud data. Returns centroid, deterministic unit normal, signed point residuals, RMS residual and maximum absolute residual. Accepts points already parsed by the caller from scan data or mesh vertices. Computes parameters only; it does not create a surface body. Requires at least three non-collinear finite points.
Paramètres, retour & exemple (1)
Paramètrespoints· array · requis
Point cloud as [x, y, z] coordinate triples in model units.
Exemple d'appel{"name": "fit_plane", "arguments": {"points": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - flatten_pattern≈ 223 tokens
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). Any number of parallel bends; crossing bends need corner relief. Pass { file } or { code }; optional { featureId } to pick a specific Shape.
Paramètres, retour & exemple (3)
Paramètrescode· string · optionnelfile· string · optionnel
Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.featureId· string · optionnel
Exemple d'appel{"name": "flatten_pattern", "arguments": {"code": "texte", "file": "texte", "featureId": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - get_latest_render≈ 1025 tokens
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. error "mesh_timeout" means the model took too long to build for a preview; the source is not wrong (it still exports) — do not rewrite it to fix the render.
Paramètres, retour & exemple (3)
Paramètresslug· string · requis
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.view· string · optionnel · all | iso | front | back | left | right | top
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· boolean · optionnel
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).
Exemple d'appel{"name": "get_latest_render", "arguments": {"slug": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}], "structuredContent": {"ok": true, "hint": "texte", "view": "texte", "bytes": 1, "error": "texte", "width": 1, "height": 1, "image_b64": "texte", "truncated": true}} - get_model_mesh≈ 190 tokens
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.
Paramètres, retour & exemple (1)
Paramètresslug· string · requis
Project slug from open_in_studio/get_project.
Exemple d'appel{"name": "get_model_mesh", "arguments": {"slug": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - get_project≈ 952 tokens
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 — prefer list_my_projects to find a project to continue. Read-only: this tool never shows a viewer (only open_in_studio does, once per response). Paint phases: projectSaved/meshReady reflect fetch state; viewerPainted stays false. Use open_in_studio (with code) to publish+paint — do NOT call get_model_mesh or get_latest_render for interactive paint.
Paramètres, retour & exemple (1)
Paramètresslug· string · optionnel
The project slug from a listing or a /p/<slug> Studio link. Omit to list the signed-in user's saved projects.
Exemple d'appel{"name": "get_project", "arguments": {"slug": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}], "structuredContent": {"ok": true, "url": "texte", "code": "texte", "slug": "texte", "title": "texte", "assets": {}, "meshUrl": "texte", "privacy": "texte", "version": 1, "embedUrl": "texte", "meshHint": "texte", "projects": []}} - get_project_revision≈ 435 tokens
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.
Paramètres, retour & exemple (2)
Paramètresslug· string · requis
Project slug returned by open_in_studio.version· integer · requis
Positive immutable revision version returned by open_in_studio.
Exemple d'appel{"name": "get_project_revision", "arguments": {"slug": "texte", "version": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}], "structuredContent": {"ok": true, "code": "texte", "slug": "texte", "title": "texte", "assets": {}, "version": 1, "parameters": []}} - get_selection≈ 274 tokens
Use this when you need to read the human/agent selection in a local Studio session. Returns one clicked face or edge (or null), with current-generation mesh-local shapeIndex/kind/id and creating featureId. During a rebuild selection is null with “selection pending rebuild” until Studio uniquely verifies the face; ambiguous or deleted faces are cleared. Inspect the current shape before authoring a fillet. Requires a running local Studio opened on the same script; hosted sessions are not supported.
Paramètres, retour & exemple (2)
Paramètressession· string · requis
Studio sessionToken from GET /__kernelcad/session?script=<path>. Use the same script as the viewer.studio_url· string · requis
Local Studio HTTP origin, e.g. http://localhost:5173.
Exemple d'appel{"name": "get_selection", "arguments": {"session": "texte", "studio_url": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - import_handoff≈ 314 tokens
Use this when you need to place parts from a LabWired handoff.json into a KernelCAD assembly. Pass the parsed handoff object using schema labwired-kernelcad-handoff/0.1. The tool validates the handoff and returns an evaluable assembly script with corner-anchored bbox placeholder solids, origin/bbox-face/mounting-hole/pin anchors, endpoint connectivity mates for wires whose two endpoint positions are known, and structured cutout_hints from connector faces. These mates express connectivity intent only; no wire geometry or routing is generated. It does not cut enclosure walls or fetch STEP/GLB assets. position_mm locates the bbox lower corner; bbox.center is derived. Null, estimated, proposed, and other non-exact geometry is reported as warnings and omitted or placed at zero as appropriate.
Paramètres, retour & exemple (1)
Paramètreshandoff· object · requis
Parsed handoff.json object using labwired-kernelcad-handoff/0.1.
Exemple d'appel{"name": "import_handoff", "arguments": {"handoff": {}}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - import_step≈ 564 tokens
Use this when the user wants to start from their own STEP or STL file (a part they designed elsewhere, a vendor model). Give exactly one source: url (a public https direct-download link), upload (a file the user attached in ChatGPT), or content_base64 (raw bytes, small files only). Max 50 MB. The format is detected from the bytes (or pass format: 'step' | 'stl'). Writes the file and a starter <name>.kcad.ts whose base body is lib.fromSTEP / lib.fromSTL into output_dir (default: a fresh temp dir), evaluates it, and returns { ok, format, model_path, script_path, code, bbox }. Pass script_path as { file } to evaluate_script, add_feature, dfm_review, export and the other tools, or edit code to build on the body. STL is a mesh: booleans, bbox and export work, but faces stay planar facets (use mesh_to_features for an editable feature tree). A non-watertight STL is refused unless allow_open is true.
Paramètres, retour & exemple (8)
Paramètresurl· string · optionnel
Public https URL that downloads the .step/.stp/.stl file directly.name· string · optionnel
Base name for the written files. Default 'imported'.format· string · optionnel · step | stl
Override format detection.upload· object · optionnel
ChatGPT file reference for a file the user attached.file_name· string · optionnel
Original file name, used for format detection.allow_open· boolean · optionnel
STL only: accept a non-watertight mesh as an open shell.output_dir· string · optionnel
Where to write the file and starter script. Default: a new temp directory.content_base64· string · optionnel
The file bytes, base64-encoded (small files).
Exemple d'appel{"name": "import_step", "arguments": {"url": "texte", "name": "texte", "format": "step", "upload": {}, "file_name": "texte", "allow_open": true}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - inspect≈ 1885 tokens
Use this when you need to read facts about a model. One reader, selected by `of`: - 'assembly' — physical assembly inventory (parts, bboxes, connectors, mates, disconnected solids). - 'robot' — URDF/SDFormat export preview (links, joints, planning groups, end-effectors, issues). - 'step' — inspect an imported STEP file: solid tree, exact bbox/volume, cylindrical holes (breached bores flagged partial; holeDetection: 'exact' | 'heuristic'). - 'shape' — volume / surfaceArea / bbox for one feature ({ feature_id? }). - '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). - 'features' — features captured by the script (kind, id, params, transforms, suppression). - 'assemblies' — assembly intent (assemblies, parts, connectors, joints). - 'topology' — canonical face names + edge count for a feature ({ feature_id? }). - 'edges' — edges of a shape with optional EdgeQuery ({ feature_id?, query? }); returns @kc[...] refs. - 'face-edges' — boundary edges of a named canonical face ({ feature_id?, face_name }). - 'faces' — faces of a shape with optional FaceQuery ({ feature_id?, query? }); returns @kc[...] refs. - 'face-labels' — user-applied labels visible in the script. - 'mates' — mates captured by the script. - 'constraints' — sketch constraints captured by the script. - 'part-stats' — bundled parts-catalog statistics. - 'bend-table' — sheet-metal bend table for a flattened pattern. - 'params' — declared model parameters. - 'part-categories' — top-level part-catalog categories available in the bundled (and configured remote) catalog. - 'part-families' — part families within a category ({ category? }); count + exemplar ids per family. - '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 (`process` + `processSource`), catalog provenance for purchased parts, and totals; `bom.*` diagnostics flag rows with no density source or missing catalog vendor info instead of guessing. - '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. - 'continuity' — G0/G1/G2 classification of shared edges ({ feature_id?, edges? }); position gap, normal jump, curvature difference, worst-sample XYZ. - 'curvature' — per-face Gaussian and mean curvature min/max/mean, inflections, spikes ({ feature_id?, faces?, spike_factor? }). - 'multi-material' — explicit material leaves shadowed by later attributed boolean descendants, with assembly-part rewrite templates; analyzes capture records and does not change mesh attribution. All params except `of` are subject-specific and forwarded verbatim. Most subjects accept { file | code }. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
Paramètres, retour & exemple (17)
Paramètresat· number · optionnel
of:'section' — single slice position along `axis` (mm).of· string · requis · assembly | robot | step | shape | mass | features | assemblies | topology
Which facts to read.axis· string · optionnel · x | y | z
of:'section' — normal axis for `at` / `stack` (default 'z').code· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from request_upload — not a path on your machine.edges· object|array|string · optionnel
of:'continuity' — optional EdgeQuery or @kc[...] ref(s) limiting which shared edges are sampled.faces· object|array|string · optionnel
of:'curvature' — optional FaceQuery or @kc[...] ref(s) limiting which faces are sampled.plane· string|object · optionnel
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`.query· object · optionnel
of:'edges'|'faces' — optional EdgeQuery/FaceQuery filter.stack· object · optionnel
of:'section' — dense scan: `count` slices evenly spaced from `from` to `to` along `axis`; response reports minAreaIndex/minAreaPosition.density· number · optionnel
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.assembly· string · optionnel
of:'assembly'|'robot'|'bom' — assembly name; defaults to the first captured assembly.category· string · optionnel
of:'part-families' — optional top-level category to filter families by.face_name· string · optionnel · top | bottom | left | right | front | back
of:'face-edges' — canonical face name (required for that subject).feature_id· string · optionnel
of:'shape'|'mass'|'topology'|'edges'|'faces'|'face-edges'|'face-labels' — FeatureId; defaults to the last returned shape.spike_factor· number · optionnel
of:'curvature' — spike sensitivity as a multiple of the face's Gaussian stddev (default 6).gyration_axis· object · optionnel
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.
Exemple d'appel{"name": "inspect", "arguments": {"of": "assembly"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - inspect_nurbs≈ 284 tokens
Use this when you need the captured NURBS definition for a kernelCAD nurbsCurve/spline3d feature. Returns degree, distinct knots and multiplicities, poles, weights, rational and uniformWeights flags, hasNonUnitWeights, and parameter range. Defaults to the last captured curve; pass feature_id to choose one. Reports authored data, not exact geometry-derived B-rep edge/face NURBS. Surface extraction and blending are not supported.
Paramètres, retour & exemple (3)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.feature_id· string · optionnel
Optional curve3d FeatureId; defaults to the last captured NURBS curve.
Exemple d'appel{"name": "inspect_nurbs", "arguments": {"code": "texte", "file": "texte", "feature_id": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - lookup_api≈ 280 tokens
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.
Paramètres, retour & exemple (1)
Paramètresintent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.
Exemple d'appel{"name": "lookup_api", "arguments": {"intent": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - lookup_authoring_skill≈ 428 tokens
Return the kernelcad-authoring skill — conventions for writing .kcad.ts scripts (API surface, parameters, evaluation contract, common pitfalls) — in sections. Call with NO arguments first: you get the quick-start (units, axes, the return rule, the rules that prevent most failures, the intent → API routing table, the "Before you finish" checklist) and an index of every section with a one-line summary (under 16k chars). Then pull what you need: `{ section: "<id>" }` returns one section (e.g. "top-level-functions", "materials", "dfm-gates-print-readiness"); `{ query: "fillet after subtract" }` returns the best-matching sections. `{ section: "all" }` returns the full ~140k-char skill (SKILL.md plus its reference files) — only if your client accepts large responses. Clients that list resources can also read `kernelcad://skills/authoring` (the SKILL.md core). OUTPUT: { uri, mimeType, mode, text, sections? } — `mode` is index | section | search | all | not-found.
Paramètres, retour & exemple (3)
Paramètresquery· string · optionnel
Keywords to search section titles and bodies (e.g. "sweep along helix").topic· string · optionnel
Alias of section; also accepts a loose title such as 'materials' or 'cli commands'.section· string · optionnel
Section id from the index (e.g. 'top-level-functions'), or 'all' for the full skill.
Exemple d'appel{"name": "lookup_authoring_skill", "arguments": {"query": "texte", "topic": "texte", "section": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - lookup_cookbook≈ 373 tokens
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.
Paramètres, retour & exemple (4)
Paramètresk· number · optionnel
Max snippets to return. Default 3, max 5.id· string · optionnel
Exact snippet id as the skills cite it (e.g. "clearance-hole-through-plate"); returns that snippet. An unknown id is ranked as a query.query· string · optionnel
Natural-language description of what you want to do (e.g. "round the rim of a hole", "build an L-bracket"). One of query / id is required.intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.
Exemple d'appel{"name": "lookup_cookbook", "arguments": {"k": 1, "id": "texte", "query": "texte", "intent": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - lookup_diagnostics≈ 150 tokens
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.
Paramètres, retour & exemple (0)
Exemple d'appel{"name": "lookup_diagnostics", "arguments": {}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - mesh_boolean≈ 376 tokens
Use this when the user wants to union, subtract, or intersect two imported triangle mesh solids (STL, OBJ, or 3MF). Supports union, subtract (A minus B) and intersect. Pass each operand as { file } on the MCP server or { data } with base64 mesh bytes; formats are detected or may be specified. Returns volume in mm³, triangle count and a binary STL as data_base64; pass that payload to import_step to continue modeling. Inputs must be closed, consistently oriented 2-manifold meshes. Open, non-manifold, or invalid meshes return an error. This computes mesh geometry and does not create an editable B-rep feature tree.
Paramètres, retour & exemple (5)
Paramètresa· object · requis
First mesh: { file } or { data } base64, optional format stl|obj|3mf.b· object · requis
Second mesh: { file } or { data } base64, optional format stl|obj|3mf.operation· string · requis · union | subtract | intersecttoleranceMm· number · optionnel
Vertex weld tolerance in mm. Default 0.000001.maxTriangles· integer · optionnel
Maximum triangles per input and output. Default and maximum 100000.
Exemple d'appel{"name": "mesh_boolean", "arguments": {"a": {}, "b": {}, "operation": "union"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - mesh_summary≈ 513 tokens
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. Use 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. INPUT: `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). OUTPUT: { 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.
Paramètres, retour & exemple (3)
Paramètresparams· object · optionnel
Optional map of parameter-name → numeric value, applied as overrides before meshing (stateless slider recompute).source· string · requis
The .kcad.ts script source to mesh.fileName· string · optionnel
Optional file-name label used in diagnostics (does not affect geometry).
Exemple d'appel{"name": "mesh_summary", "arguments": {"source": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - mesh_to_features≈ 935 tokens
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. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
Paramètres, retour & exemple (9)
Paramètresout· string · optionnel
Write the emitted script to this .kcad.ts path and the assumption ledger to the sibling .ledger.json.data· string · optionnel
Mesh bytes as base64 — use when the server cannot see your filesystem.file· string · optionnel
Path to a .stl (binary or ASCII), .obj or .3mf mesh. One of file / data is required. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from request_upload — not a path on your machine.format· string · optionnel · stl | obj | 3mf
Format override; default from the extension or the content.minIoU· number · optionnel
Volume IoU a faithful verdict requires. Default 0.98.maxPasses· number · optionnel
Refinement passes, 1–4. Default 4; stops early at the first faithful pass.maxTriangles· number · optionnel
Refuse meshes above this triangle count instead of stalling. Default 300000.maxDeviationMm· number · optionnel
Max surface deviation (mm) a faithful verdict allows. Default max(0.25, 0.1 % of the bbox diagonal).weldToleranceMm· number · optionnel
Vertex weld distance in mm. Default max(1e-4, 1e-6 × bbox diagonal).
Exemple d'appel{"name": "mesh_to_features", "arguments": {"out": "texte", "data": "texte", "file": "texte", "format": "stl", "minIoU": 1, "maxPasses": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - open_in_studio≈ 3796 tokens
Save the model as a kernelCAD project AND show it: persists a project revision, returns the interactive Studio viewer (MCP Apps / ChatGPT outputTemplate), and includes a PNG preview in the SAME tool result (image content + previewUrl when available). ONE VIEWER PER PROJECT PER RESPONSE: every call renders a new viewer card. Do all validation with evaluate_script first, then call open_in_studio exactly once, after validation succeeds; reuse the returned URL, revision and preview, and never call it again after a successful result in the same response. Re-calling with unchanged code for the same project returns that revision instead of writing a new one. CONTINUE, DO NOT DUPLICATE: to change a model you already saved, pass `project: '<slug>'` from the last result (or from list_my_projects) — this adds a revision to that project. Without `project`, the save goes to the project this chat already saved, or to your project with the same title (case, punctuation and v2/rev3/(1) ignored) from the last 24 h. Views, poses, colours and options of one design are revisions of ONE project — keep the same title and slug. Pass `new_project: true` only when the user wants a separate design. A different cookbook (execute_cookbook, or open_in_studio of that cookbook's unchanged source) starts its own project; pass `project` to add a revision, or `continue_design: true` to keep revising the design this chat is already saving. The result starts with the slug to pass next time, a /p/<slug>?version= link for this revision, and that revision's title. 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). Code that fails evaluate_script (for example overlapping same-material members or floating pieces) is refused; fix it first. A broken mechanism verdict alone does NOT refuse: the revision is saved, Studio shows "Mechanism broken", and the result returns mechanismSummary (statement, maxLevel, failures with the joint). Tell the user the mechanism is broken; do not call it working. 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. Status fields: ok=true means the project revision was saved (projectSaved=true). meshSaved reports whether its display mesh is persisted; meshStatus=failed means meshSaved=false, but the saved project remains usable for geometry checks. Do not claim its 3D 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 (it shows no viewer) — do not re-call open_in_studio, and 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. INDEPENDENT OF EXPORT/STEP: call this for shaded paint even while export is running, timed out, or returned export.deferred — mesh paint does not wait on STEP. Never block open_in_studio on a STEP download. 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 once after you finish a build, and once per response 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. Declare dimensions in the source with shape.dimension({ kind, from, to, label }) (label is a name; the measured value is appended) and they show on the model in every viewer; add ?dims=1 to a /p link to force dimensions on. MARK & FIX: a user message starting `Edit kernelCAD project <slug> (revision N): "<note>". Targets: #1 feature "<id>" ...` comes from pins the user tapped in the viewer. Feature/part ids are the script's own feature and part names (assembly part names, named shapes); points are world mm. Call get_project with that slug, change only the named features near those points, keep everything else, then open_in_studio with project set to the same slug. Hosted: lib.fromSTEP / fromSTL / fromDXF / fromSVG and referenceImage take a direct string literal or a const bound to one (computed expressions are unsupported). They accept "asset:<id>" (from request_upload), an https:// URL or a data: URI as the path.
Paramètres, retour & exemple (17)
Paramètrescode· string · optionnel
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.slug· string · optionnel
Older name for `project`. Use `project`.title· string · optionnel
Optional human-readable title for the model (shown in Studio). Defaults to "Model from Claude".intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.wheels· array · optionnel
Wheel centres + radii for likeness gate [{ center:[x,y,z], radius }].project· string · optionnel
Slug of the project to update (from the last open_in_studio result, a "Saved to your projects" note, list_my_projects, or a /p/<slug> link). Adds a new revision to that project instead of creating a new one, and live-updates the user's open Studio tab.body_bbox· object · optionnel
Body AABB { min:[x,y,z], max:[x,y,z] } mm — for likeness_profile gate when no session attest.anon_token· string · optionnel
Anonymous owner token returned as `anonToken` by an earlier open_in_studio result. Pass it on every open_in_studio call, also in a new chat, so all your anonymous projects stay together and move to the user's account when they sign in. Omit when you have none.cabin_bbox· object · optionnel
Optional cabin AABB for likeness gate.parameters· array · optionnel
Optional list of the model's editable parameters, so Studio can render parameter controls. Each item is one control derived from the .kcad params.attachments· array · optionnel
Complementary project files referenced by relative path from the .kcad source.new_project· boolean · optionnel
Pass true only when the user wants a separate, new design. Default: continue this chat's project, or your project with the same title from the last 24 h. Still wins over a matching title or cookbook.require_stills· boolean · optionnel
Forwarded to body-likeness gate (default true).still_verdicts· array · optionnel
Agent still checklist for likeness gate [{ code, passed, finding, view? }].continue_design· boolean · optionnel
Pass true to add a revision to the design this chat is already saving, even when this call is a different cookbook or title. Ignored when `project` is set.include_preview· boolean · optionnel
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· string · optionnel · automotive
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.
Exemple d'appel{"name": "open_in_studio", "arguments": {"code": "texte", "slug": "texte", "title": "texte", "intent": "texte", "wheels": [], "project": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}], "structuredContent": {"ok": true, "url": "texte", "slug": "texte", "title": "texte", "animUrl": "texte", "meshUrl": "texte", "updated": true, "version": 1, "embedUrl": "texte", "meshHint": "texte", "meshError": "texte", "meshReady": true}} - order_part≈ 414 tokens
Order the part made: creates the production request and returns a pay_url for the user. Propose the manufacturing method from the user's words and the part, pass it as method with a one-line reason. The price is the real maker price; never invent or send one. Tell the user the card is only held, and a person confirms the final price before charging. If the result is status "pricing", the price is still being worked out: call again in a few seconds.
Paramètres, retour & exemple (3)
Paramètresslug· string · optionnel
Saved project slug (from open_in_studio or a /p/<slug> link). Send slug or source, not both.method· object · optionnel
How the part should be made. Propose it from the user's words and the part (flat sheet: laser_cut or sheetmetal; metal block: cnc; plastic: fdm_print or resin_print).source· string · optionnel
The kernelCAD script, when the part is not saved. Send slug or source, not both.
Exemple d'appel{"name": "order_part", "arguments": {"slug": "texte", "method": {}, "source": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - price_part≈ 357 tokens
Start or read the real price for making the part. Cheap. Returns status "ready" with estimate_cents and summary, or "pricing" while the makers are asked (call again in a few seconds). Creates nothing and charges nothing.
Paramètres, retour & exemple (3)
Paramètresslug· string · optionnel
Saved project slug (from open_in_studio or a /p/<slug> link). Send slug or source, not both.method· object · optionnel
How the part should be made. Propose it from the user's words and the part (flat sheet: laser_cut or sheetmetal; metal block: cnc; plastic: fdm_print or resin_print).source· string · optionnel
The kernelCAD script, when the part is not saved. Send slug or source, not both.
Exemple d'appel{"name": "price_part", "arguments": {"slug": "texte", "method": {}, "source": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - project_curve≈ 515 tokens
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.
Paramètres, retour & exemple (7)
Paramètrescode· string · requis
The .kcad.ts source code.face· string · requis
Target face — canonical name or label.asEdge· boolean · optionnel
Open-wire (edge) projection. NOT IMPLEMENTED — rejected at edit time. Use a closed-curve projection (omit asEdge).bindAs· string · optionnel
Optional local variable name; emits `const <bindAs> = <target>.projectCurve(...);`.target· string · requis
Variable name of the Shape to chain onto.commands· array · requis
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"}]).scaleMode· string · optionnel · original | native | bounds
Drawing.sketchOnFace scaling mode. Default original.
Exemple d'appel{"name": "project_curve", "arguments": {"code": "texte", "face": "texte", "target": "texte", "commands": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - query≈ 631 tokens
Use this when you need to resolve or inspect topology against a script's lowered geometry. Pass the script as `code` (inline; works on a hosted server) or `file`. Selected by `mode` (default 'evaluate'): - 'evaluate' — list the faces a Query matches ({ query }). Pass expect:'unique' to assert exactly-one. - 'resolve' — resolve one ref to one face ({ ref }). - 'lineage' — the creating/modifying history of a face ({ ref }; feature_id defaults to the last feature). Query forms (faces only; edge/vertex kinds return query.unsupported-entity-type): - a bare face label: 'top', 'bottom', 'left', 'right', 'front', 'back', or a hole/cutout slot like 'wall'. - @kc[<feature-id>/face/<label>] — feature ids are the ones refs print, e.g. '@kc[box_1/face/top]', '@kc[hole_1/face/wall]'. - @kcq[face(<filter>, ...)] — filters AND together: createdBy("box_1"), withLabel("top"), geometryType(PLANE|CYLINDER|CONE|SPHERE|TORUS|BSPLINE_SURFACE), closestTo([x,y,z]) or closestTo([x,y,z], k), containsPoint([x,y,z]); combine with union(a, b), intersection(a, b), subtraction(a, b). Example: '@kcq[face(geometryType(CYLINDER), closestTo([0,0,10]))]'. Each matched face comes back with its canonical @kc ref, centroid, normal and area.
Paramètres, retour & exemple (7)
Paramètresref· string · optionnel
mode:'resolve'|'lineage' — one face: '@kc[box_1/face/top]', '@kcq[...]', or '<feature-id>.<label>' (lineage).code· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.mode· string · optionnel · evaluate | resolve | lineage
Resolution mode (default 'evaluate').query· string|object · optionnel
mode:'evaluate' — Query: a bare face label ('top'), an @kc[<feature-id>/face/<label>] ref, an @kcq[face(...)] expression, or { ast }.expect· string · optionnel · any | unique
mode:'evaluate' — 'unique' asserts exactly-one.feature_id· string · optionnel
Optional FeatureId; defaults to the last lowered shape (use "auto" for lineage).
Exemple d'appel{"name": "query", "arguments": {"ref": "texte", "code": "texte", "file": "texte", "mode": "evaluate", "query": {}, "expect": "any"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - ray_pick≈ 518 tokens
Use this when you need the faces a ray hits in a local Studio model, nearest first, with points, distances, and normals. Inputs are model units (mm); direction is normalized. Requires the local Studio URL and session token for the same script, reads the current model generation, and returns a set_selection argument object with every hit. feature_id must identify a displayed terminal shape; intermediates have no current viewer shapeIndex. Intersections use the viewer per-face tessellation, so curved-surface points and normals are mesh approximations.
Paramètres, retour & exemple (7)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.origin· array · requis
Ray origin [x, y, z] in model units.session· string · requis
Studio sessionToken for this script, from GET /__kernelcad/session?script=<path>.direction· array · requis
Nonzero ray direction [x, y, z]; normalized internally.feature_id· string · optionnel
Displayed terminal feature to ray-pick; defaults to the returned feature. Intermediate features are not available as current viewer selections.studio_url· string · requis
Local Studio HTTP origin, e.g. http://localhost:5173.
Exemple d'appel{"name": "ray_pick", "arguments": {"origin": [], "session": "texte", "direction": [], "studio_url": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - remove_feature≈ 207 tokens
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.
Paramètres, retour & exemple (2)
Paramètrescode· string · requis
The .kcad.ts source code.match· string · requis
A substring that uniquely identifies the line to remove (e.g. `const hole = cylinder(5,`).
Exemple d'appel{"name": "remove_feature", "arguments": {"code": "texte", "match": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - render_preview≈ 2315 tokens
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. PUBLISH PRESET: pass { preset: 'publish' } for a share-ready studio product shot (gallery tile, social post, README image, product page): key/fill/rim lights + room reflections, soft contact shadow, clean backdrop ({ background: 'white' (default) | 'light' | 'dark' | 'black' | '#rrggbb' | 'transparent' } — transparent gives a PNG with alpha), { shadow: false } to drop the shadow, 2× supersampled anti-aliasing, 30° lens, the model silhouette centred and auto-framed with ~11% air (a script's setCameraTarget is ignored), per-part colours/materials as authored, no watermark. With no views/pose it renders ONE image named 'hero' (3/4 front-right, az=30°, el=22°) at 1600×1200; width/height go up to 2048; views/pose still work under the preset. Output is deterministic for the same input. For a 360° loop use capture_animation({ turntable: true }). INSPECTION SHEET: { sheet: true } renders all seven views (iso, front, back, left, right, top, bottom) and adds one labelled image named 'sheet' tiling them — do not call a model done because it compiled; call it done when every tile of the sheet matches the request. 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. Hosted server: the PNGs come back IN the result as image content (up to ~1.5 MB total; larger sets are link-only) and each `images[i].url` is an HTTPS link that expires after 24 h. `images[].path` is a server-side path you cannot open. Works without saving a project (autosave:false is fine). Hosted: lib.fromSTEP / fromSTL / fromDXF / fromSVG and referenceImage take a direct string literal or a const bound to one (computed expressions are unsupported). They accept "asset:<id>" (from request_upload), an https:// URL or a data: URI as the path.
Paramètres, retour & exemple (21)
Paramètrescode· string · optionnel
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· string · optionnel
Path to a .kcad.ts script on disk. Mutually exclusive with code. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.hide· array · optionnel
Hide matching feature ids / assembly part names. Mutually exclusive with focus.pose· string · optionnel
Extra arbitrary camera pose '<az>,<el>' in degrees, e.g. '30,20'.focus· array · optionnel
Show only matching feature ids / assembly part names. Mutually exclusive with hide.sheet· boolean · optionnel
Also write one labelled image 'sheet' tiling every rendered view. With no views it renders all seven (adds back, left, bottom) — use it before calling a model done, so a missing cutout on the back or underside is not missed.views· array · optionnel
Canonical views to render as an array, e.g. ["iso"] or ["front","top"] (default: all four). Fewer views = faster.width· integer · optionnel
Per-view tile width in px (default 768; 1600 under preset: 'publish').height· integer · optionnel
Per-view tile height in px (default 768; 1200 under preset: 'publish').intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.preset· string · optionnel · default | publish
Render look: 'default' (engineering review) or 'publish' (studio product shot for sharing; one 'hero' image unless views/pose are given).shadow· boolean · optionnel
preset 'publish' only: soft contact shadow under the model (default true).explode· object · optionnel
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().out_dir· string · optionnel
Directory for the PNGs (created if missing). Default: a fresh temp session dir.overlay· string · optionnel · zebra | curvature | continuity
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.section· object · optionnel
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).base_url· string · optionnel
Advanced: force a specific render server (e.g. a running studio dev server) instead of the bundled static player.background· string · optionnel
preset 'publish' only: 'white' (default), 'light', 'dark', 'black', 'transparent' (PNG alpha), or '#rrggbb'.environment· string · optionnel
HDRI environment override: preset ('studio', 'softbox', 'neutral', 'outdoor', 'warehouse'), a URL, or 'none' for the default three-light rig.no_watermark· boolean · optionnel
Suppress the kernelCAD version watermark.no_mechanism_check· boolean · optionnel
Skip the mechanism-truth probe for fast iteration on large assemblies; the preview reports mechanism: 'unverified'. Ignored under KERNELCAD_RENDER_STRICT=1.
Exemple d'appel{"name": "render_preview", "arguments": {"code": "texte", "file": "texte", "hide": [], "pose": "texte", "focus": [], "sheet": true}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - repair_script≈ 556 tokens
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 }.
Paramètres, retour & exemple (6)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.strategy· string · optionnel · apply-first | try-all | dry-run
'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.diagnostic· string · optionnel
Diagnostic id from why_did_this_fail's `targetDiagnosticId` / `candidates[].diagnosticId`, or 'first-error' (default) for the first error-severity diagnostic.max_attempts· integer · optionnel
Upper bound on candidates attempted (default 3). Ignored by apply-first and dry-run.
Exemple d'appel{"name": "repair_script", "arguments": {"code": "texte", "file": "texte", "intent": "texte", "strategy": "apply-first", "diagnostic": "texte", "max_attempts": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - request_upload≈ 368 tokens
Use this when the user has a photo, PDF drawing, STEP, STL, DXF, SVG or 3MF file on their device and you need it in a kernelCAD tool (trace_from_image, drawing_to_cad, mesh_to_features, inspect of:"step", or lib.fromSTEP / fromSTL / fromDXF / fromSVG / referenceImage in a script). Do not ask the user to paste the file as text or base64, and do not type coordinates from an image by hand. Returns a one-time `uploadUrl` (valid 30 minutes) and an `asset` reference. Give the user the link; after they say the upload is done, pass the `asset` value ("asset:<id>") as the file argument, for example trace_from_image({ imageUrl: "asset:<id>" }) or lib.fromSTEP("asset:<id>"). If the file is already at a public https:// URL, pass that URL instead. On clients that support MCP URL elicitation the upload page opens for the user directly and the call returns once the file is stored (status "uploaded"); then use the asset right away without asking the user anything.
Paramètres, retour & exemple (1)
Paramètrespurpose· string · optionnel
Optional short note shown on the upload page, e.g. "the photo of the worn bracket".
Exemple d'appel{"name": "request_upload", "arguments": {"purpose": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - resolve_assumptions≈ 385 tokens
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.
Paramètres, retour & exemple (2)
ParamètresledgerPath· string · requis
Path to the `<model>.ledger.json` file persisted alongside the traced source.resolutions· array · requis
One resolution per ledger fact id to act on.
Exemple d'appel{"name": "resolve_assumptions", "arguments": {"ledgerPath": "texte", "resolutions": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - review_cad≈ 1430 tokens
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. Runs within timeBudgetMs (default 90 s): stages that did not fit are listed in skippedStages (their checks did not run; mechanism is then unverified) and stageTimingsMs shows per-stage cost. Hosted: lib.fromSTEP / fromSTL / fromDXF / fromSVG and referenceImage take a direct string literal or a const bound to one (computed expressions are unsupported). They accept "asset:<id>" (from request_upload), an https:// URL or a data: URI as the path.
Paramètres, retour & exemple (19)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.assembly· string · optionnel
Assembly name; defaults to the first captured assembly.designGoal· string · optionnel
Original user design prompt or goal. Included in suggestedRepairPrompt so topology-redesign repairs restart from the intended physical design instead of local coordinate nudges.epsilonMm3· number · optionnel
Interference volume threshold in mm^3. Default 0.01.timeBudgetMs· number · optionnel
Wall-clock budget for the review in ms (default 90000). Once spent, the remaining heavy stages (pose envelope, physical use case, mechanism sweep) are skipped and listed in skippedStages — a partial result instead of a timeout. stageTimingsMs reports where the time went.combinatorial· boolean · optionnel
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.samplesPerMate· integer · optionnel
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.gripperAperture· object · optionnel
Optional fingertip connector refs for gripper aperture travel reporting.trackConnectors· array · optionnel
Optional connector refs such as ["gripper-plate.tool-tip"] to limit connector workspace reporting.preserveInterfaces· array · optionnel
External mates, connector refs, part names, or behavioral interfaces the repair agent must preserve during redesign.includeInterference· boolean · optionnel
Whether sampled poses run BREP interference checks. Default true.includePoseEnvelope· boolean · optionnel
Whether to sample declared mate limits. Default true.requirePhysicalUseCase· boolean · optionnel
When true, articulated assemblies must declare arm.physicalUseCase(...) evidence: loads, contacts, stable parts, and actuator limits.includePhysicalUseCaseStatics· boolean · optionnel
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.includePhysicalUseCaseReachability· boolean · optionnel
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.includePhysicalUseCaseJointReactions· boolean · optionnel
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· boolean · optionnel
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· integer · optionnel
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.
Exemple d'appel{"name": "review_cad", "arguments": {"code": "texte", "file": "texte", "assembly": "texte", "designGoal": "texte", "epsilonMm3": 1, "timeBudgetMs": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - review_paint_peek_latest≈ 540 tokens
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.
Paramètres, retour & exemple (3)
Paramètresslug· string · optionnel
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.paths_only· boolean · optionnel
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).freshness_sec· integer · optionnel
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".
Exemple d'appel{"name": "review_paint_peek_latest", "arguments": {"slug": "texte", "paths_only": true, "freshness_sec": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - route_wires≈ 400 tokens
Use this when you need a first-pass orthogonal pin-to-pin wire route estimate and clearance check. Accepts a LabWired handoff or explicit wire positions in millimetres, returns path length and bend count, and reports collisions against part bounding boxes. Wires whose endpoint positions are null are reported as unresolved. Read-only analysis; it does not create or certify a physical harness.
Paramètres, retour & exemple (6)
Paramètreswires· array · optionnel
Wire records with from_pos_mm and to_pos_mm as 3D millimetre coordinates.handoff· object · optionnel
LabWired handoff schema labwired-kernelcad-handoff/0.1 with parts, pins and wires.obstacles· array · optionnel
Axis-aligned obstacle volumes in world millimetres.clearance_mm· number · optionnel
Minimum obstacle clearance, default 1 mm.bend_radius_mm· number · optionnel
Requested minimum bend radius, default 2 mm.board_surface_z_mm· number · optionnel
Known world Z of the LabWired board surface. Required to reconcile 2D endpoint coordinates and XY-only part placements for complete clearance analysis.
Exemple d'appel{"name": "route_wires", "arguments": {"wires": [], "handoff": {}, "obstacles": [], "clearance_mm": 1, "bend_radius_mm": 1, "board_surface_z_mm": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - run_fea≈ 1156 tokens
Use this when you need to know whether a part will hold a load. Runs a linear-static structural study and returns evidence — peak von Mises stress (MPa), peak displacement (mm), the minimum safety factor against the material yield (taken away from the clamp-singular edges of the fixed faces; the raw clamp-edge peak is reported separately as peakAtSupportMPa), per-region hot spots named by @kc[...] face ref, mesh trust flags, an equilibrium residual, and (CalculiX only) stress-heatmap PNG paths. The study is EITHER declared in the script with `shape.feaStudy({ material, fixed, loads, meshSize?, minSafetyFactor? })` OR passed on the call against the shape the script returns: { code: 'return box(100, 20, 10);', material: 'aluminum-6061', fixed: { atX: 0 }, loads: [{ faces: { atX: 100 }, force: [0, 0, -200] }] }. Faces are a FaceQuery ({ atX | atY | atZ, byNormal: 'Z', near: [x,y,z], ... }), a face label ('top', 'bottom', 'left', 'right', 'front', 'back'; it must name ONE face — after a boolean 'top' can be several, which is an error listing them) or an @kc[...] ref. Force is the TOTAL [Fx, Fy, Fz] in N on those faces (a scalar force + direction is accepted). Materials: mild-steel, aluminum-6061, pla, petg, abs, nylon (aliases steel, aluminum), or { E, nu, yield } in MPa. Solver (`solver`, default 'auto'): CalculiX + gmsh quadratic tets when that toolchain is installed; otherwise the built-in in-process voxel solver (8-node incompatible-mode bricks), which needs nothing installed and is marked summary.solver 'in-process-voxel' with trust.meshTrusted false — an estimate (accurate for prismatic bending, approximate at curved faces and notches), never a verified pass. solver: 'calculix' fails up front with fea.solver.unavailable and the install command when the toolchain is absent. Also: `study` (a declared study name; default the last), `output_dir` (keeps the deck / summary JSON), `mesh_size` (mm, overrides the study for this run), `heatmaps: false` for a numbers-only run. CalculiX mesh refinement is automatic: when the stress is untrusted only because the solver's error estimate is high, it re-solves once at 0.75x the element size (inside the element budget), with summary.refinement listing each pass. `refine: false` solves once.
Paramètres, retour & exemple (14)
Paramètrescode· string · optionnel
Inline kernelCAD script source (mutually exclusive with file).file· string · optionnel
Path to a .kcad.ts script declaring at least one feaStudy. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.fixed· string|object · optionnel
Inline study: faces held fixed — a FaceQuery like { atX: 0 }, a face label like 'bottom', or an @kc[...] ref.loads· array · optionnel
Inline study: loads, each { faces, force: [Fx, Fy, Fz] } — total force in N on those faces.study· string · optionnel
Name of the declared study to run; defaults to the last declared one.refine· boolean · optionnel
One automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true). false: one solve at mesh_size.solver· string · optionnel · auto | calculix | in-process
'auto' (default): CalculiX when installed, else in-process. 'calculix': require it. 'in-process': always the built-in voxel solver.heatmaps· boolean · optionnel
Render stress heatmap PNGs (default true).material· string|object · optionnel
Inline study: material grade name (e.g. 'aluminum-6061') or { E, nu, yield } in MPa.mesh_size· number · optionnel
Target element size in mm, overriding the study for this run.output_dir· string · optionnel
Directory for the solver deck, results, summary JSON and heatmap PNGs.mesh_timeout_ms· number · optionnel
Wall-clock budget for meshing (default 120000).solve_timeout_ms· number · optionnel
Wall-clock budget for the solve (default 300000).min_safety_factor· number · optionnel
Inline study: required minimum safety factor; below it the call fails with fea.safety-factor.below-min.
Exemple d'appel{"name": "run_fea", "arguments": {"code": "texte", "file": "texte", "fixed": {}, "loads": [], "study": "texte", "refine": true}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - send_to_printer≈ 866 tokens
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). bambu-lan uploads a .gcode.3mf print project (the printer prints 3MF projects, not bare G-code): the G-code goes in as Metadata/plate_1.gcode, inside the model 3MF from export format '3mf' when model_3mf_path is given (use options { arrange: 'plate', slicer: 'bambu' } so the printer shows the same named, coloured parts), else inside a minimal 3MF shell; the file name always ends in .3mf ('part.gcode' -> 'part.gcode.3mf'). Optional printer (a bundled profile id, the same ids as the export 3mf/gcode options.printer) is checked against protocol before anything is read or sent: an unknown id is refused with the list of valid ids, 'bambu-lan' needs a Bambu Lab profile and a Bambu Lab profile needs 'bambu-lan'. Pass { dry_run: true } to validate connectivity/authentication only, without uploading or starting a print. Never logs or echoes api_key/access_code.
Paramètres, retour & exemple (12)
Paramètreshost· string · requis
Printer hostname or IP.port· number · optionnel
Override the protocol default port.serial· string · optionnel
Bambu printer serial number (required to start a print unless start_print is false).api_key· string · optionnel
OctoPrint API key (Settings -> API).dry_run· boolean · optionnel
Validate connectivity/auth only; never uploads or starts a print.printer· string · optionnel · generic-fdm | bambu-a1-mini | bambu-a1 | bambu-p1s | bambu-p1p | bambu-x1c | bambu-x1e | bambu-h2d
Printer profile id; checked against protocol before upload. List them with 'kernelcad print printers'.filename· string · optionnel
Uploaded file name (default: 'kernelcad.gcode'; bambu-lan appends '.3mf').protocol· string · requis · octoprint | moonraker | bambu-langcode_path· string · requis
Path to the .gcode file on disk.access_code· string · optionnel
Bambu LAN-mode access code (printer settings -> LAN Only Mode).start_print· boolean · optionnel
Start the print immediately after upload (default: true).model_3mf_path· string · optionnel
bambu-lan only: model .3mf from export format '3mf' to package the G-code into (the uploaded .gcode.3mf).
Exemple d'appel{"name": "send_to_printer", "arguments": {"host": "texte", "protocol": "octoprint", "gcode_path": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - set_param≈ 262 tokens
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).
Paramètres, retour & exemple (3)
Paramètrescode· string · requis
The .kcad.ts source code.new_value· ? · requis
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").param_name· string · requis
The string literal name of the param (first arg to param()).
Exemple d'appel{"name": "set_param", "arguments": {"code": "texte", "new_value": "texte", "param_name": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - set_scene_return≈ 293 tokens
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.
Paramètres, retour & exemple (5)
Paramètrescode· string · requis
The .kcad.ts source code.mode· string · requis · model | solvedModelposes· object · optionnel
Optional solvedModel pose overrides keyed by mate name. Defaults to {}.options· object · optionnel
Optional solvedModel options such as { validate: 'warn', posesGate: 'envelope' }.assembly_binding· string · requis
JS identifier bound to assembly(...).
Exemple d'appel{"name": "set_scene_return", "arguments": {"code": "texte", "mode": "model", "assembly_binding": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - set_selection≈ 372 tokens
Use this when you need to replace the shared local Studio face/edge selection, or clear it with selection:null. The viewer highlights the pick on its next sync (300 ms). Does not edit geometry. Pass model_generation from get_selection; writes from an older generation are rejected. Use only current shape indices. Requires a local Studio session.
Paramètres, retour & exemple (4)
Paramètressession· string · requis
Studio sessionToken from GET /__kernelcad/session?script=<path>. Use the same script as the viewer.selection· ? · requisstudio_url· string · requis
Local Studio HTTP origin, e.g. http://localhost:5173.model_generation· integer · requis
modelGeneration from get_selection; rejects picks from a prior mesh.
Exemple d'appel{"name": "set_selection", "arguments": {"session": "texte", "selection": "texte", "studio_url": "texte", "model_generation": 1}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - solve_mates≈ 182 tokens
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.
Paramètres, retour & exemple (2)
Paramètresposes· object · optionnel
Optional numeric pose overrides keyed by mate name.assembly· string · optionnel
Exemple d'appel{"name": "solve_mates", "arguments": {"poses": {}, "assembly": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - solve_sketch≈ 564 tokens
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.
Paramètres, retour & exemple (2)
Paramètresentities· array · requis
Sketch entities to solve. Lines reference point ids; circles reference a center point id.constraints· array · requis
Constraints to apply to the entities.
Exemple d'appel{"name": "solve_sketch", "arguments": {"entities": [], "constraints": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - sweep_tolerance≈ 572 tokens
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.
Paramètres, retour & exemple (5)
Paramètrescode· string · optionnel
Inline kernelCAD script source.file· string · optionnel
Path to a .kcad.ts script file. Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.gates· object · optionnel
Which standard gates to run per combo.params· object · requis
param() name -> { values: [number|string, ...] } or { min, max, steps }.assembly· string · optionnel
Assembly name; defaults to the first captured assembly.
Exemple d'appel{"name": "sweep_tolerance", "arguments": {"params": {}}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - trace_from_image≈ 1099 tokens
Use this when you need to trace a reference image into normalized waypoints, or turn sketch labels into a catalog-aware draft BOM. 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. Set `detectParts: true` to request labeled component boxes, confidence, bundled-catalog candidates and unmatched labels; the BOM is a draft for review. Three backends are dispatched behind the scenes: `opencv` (deterministic; uniform-bg silhouette only), `vision-llm` (vision model; named points/cluttered backgrounds; needs a configured vision endpoint), and `hybrid` (opencv silhouette + LLM-labeled named points). Default backend is `auto`. Per-feature confidence is reported. Pair with the `kernelcad-trace-from-image` skill for the conversion-to-mm pipeline. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:<id>" from request_upload (when the file is on the user's device).
Paramètres, retour & exemple (10)
Paramètreshint· string · optionnel
Optional free-text hint forwarded to vision-LLM backends (e.g. "a pair of eyewear; trace the upper brow only").intent· string · optionnel
The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.priors· array · optionnel
Caller-supplied category-norm defaults (e.g. wall thickness) recorded verbatim as `assumed` ledger facts.backend· string · optionnel · opencv | vision-llm | hybrid | auto
Force a specific backend; default `auto` routes by corner-color stddev.features· array · optionnel
Features to trace. Defaults to a single { label: "silhouette", kind: "silhouette" } when omitted.imageUrl· string · requis
URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from request_upload — not a path on your machine.validate· string · optionnel · warn | error
Assumption-ledger strictness. `warn` (default) never blocks. `error` fails the call when any `missing` ledger fact (e.g. scale) is still open.detectParts· boolean · optionnel
Optional: use the configured vision model to detect labeled component boxes and return detectedParts plus a draftBom, normalized to the traced outline frame.scaleAnchor· object · optionnel
Pixel-to-real-world scale anchor: two measured points on the image. Absent -> the returned ledger's `scale` fact is `missing`.maxWaypointsPerFeature· integer · optionnel
Cap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines).
Exemple d'appel{"name": "trace_from_image", "arguments": {"imageUrl": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - verify≈ 4444 tokens
Use this when you need to check a design against a rule set. One verifier, selected by `check`: - 'assembly' — static assembly review ({ file | code }, or the session evaluate_script left): mate validator, default-pose interference, joint topology, mechanical plausibility. ok:false with `blocking[]` exactly when review_cad's blocking rules fire on these findings; review_cad also sweeps joint ranges and runs physics. - 'urdf' — structural validity of a .urdf file ({ urdf_path }). - 'dfm' — print-readiness gates declared by dfmSpec() ({ file | code }). - 'dfm-preflight' — sheet-metal flat pattern vs a job-shop's ordering rules ({ vendor, material, thicknessIn|thicknessMm, ... }). Returns the vendor's catalog source pages as `sources`; when `disclosure` is present, show it with those links. - 'assembly-path' — continuous straight-line removal of each assembly part along ±X/±Y/±Z and optional world-space directions. Returns valid directions and blocking parts; disassemblyOrder runs a deterministic greedy removal pass. Watertight mesh approximation, conservative contact, no rotation/mate/hardware certification. - 'swept-collision' — sweep declared joint range(s) and report colliding poses. - 'reachable' — inverse-kinematics reachability for an end-effector ({ tip_link, target_position, ... }). - 'geometry-quality' — one solid body's BREP tiny faces and short edges (ids, locations, mm²/mm), plus sampled mirror symmetry about centroid XY/YZ/XZ and principal inertia planes ({ file | code, feature_id?, tiny_face_area_mm2?, tiny_face_relative?, short_edge_length_mm?, symmetry_tolerance_mm?, mesh_deflection_mm?, asserted_plane?: { origin, normal } }). Relative area is a fraction of total surface area; thresholds are ORed. Candidate planes are discovery; only an asserted plane gates symmetry. Approximate sampled tessellation, not exact BREP proof. - 'fastener-installation' — measured explicit catalog-screw installation stations on lowered assembly BREP ({ file | code, fasteners:[{ part, against, engagementPart?, minEngagementMm?, maxProtrusionMm? }], toleranceMm?, angleToleranceDeg? }). Reports annular bearing gap, bore axis/diameter/overlap and receiver geometric engagement/protrusion. Unknown or zero coverage cannot pass. Simplified threads do not certify torque, preload or strength. - 'mounting-holes' — fastened mates: hole pairs one screw can use (equal, or clearance over a tap drill / hole({ thread }) of the same metric size; hole-free faces are a rigid bond) and fastener holes meeting at the contact face are coaxial. Sides it cannot resolve are info, never mismatches. - 'load-capacity' — will it hold? Closed-form Euler-Bernoulli beam check ({ loads, materials, ... }), or mode:'fea' to solve the script's feaStudy (quadratic-tet FEA, CalculiX) — both return { ok, safetyFactor, elements[{ partName, stressPa, yieldPa, safetyFactor }], failures[], diagnostics }; fea adds the threshold, the stress regions as @kc[...] faces with their location, and fea { peakStressPa, maxDisplacementMm, meshTrusted, peakAtSupportPa, refinement }; it refines the mesh automatically until the stress is trusted (refine: false for one solve). - 'static-hold' — gravitational holding torque/force at a sampled pose grid vs each actuated joint's declared actuator capacity ({ joint?, pose?, gravity?, min_torque_margin_pct?, range_samples? }). - 'motion-load' — loads on each driven joint (mechanicalJoint on a revolute mate) while the model moves: gravity, inertia from the animationView tracks (finite differences), optional external forces. Mass and inertia come from the solids and density/material, or a part's massKg. Returns per joint peak torque vs the mechanicalJoint torqueNm (margin; < 1x error, < 2x warning), axial / radial force and bending moment on the actuator shaft (checked only against radialLimitN / axialLimitN; without them 'no rating, not checked'), the radial load on each of up to two coaxial supports (each at its station on the shaft: the actuator at the joint origin, else the support's connector on the axis, else the middle of its material nearest the shaft; an ambiguous station is a mechanism.load.not-resolved warning, not a number), the worst pose and a torque-vs-time series ({ file | code, motion_mode?: 'tracks'|'range', sample_ms?, range_samples?, quasi_static?, gravity?, motion_loads?: [{ part, point, force, fromMs?, toMs? }], supports?: { joint: [parts] }, series_points? }). Pass supports to compare with and without a bushing. Rigid bodies, tree mate graphs, no friction. - '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. - 'edge-radius' — general edge-break specification on final BREP ({ file | code, min_radius_mm?, max_radius_mm?, require_edge_break?: 'external'|'internal'|'all', feature_id?, assembly?, parts?, edges?, faces? }). Reports sharp convex/concave edges, analytic cylindrical/toroidal fillet radii and spherical junctions, and heuristic planar chamfer strips. Radius bounds apply only to fillets; selectors/points are part-local. Unknown/empty coverage cannot pass. All params except `check` are check-specific and forwarded verbatim; each check fails closed on its own missing required params.
Paramètres, retour & exemple (67)
Paramètresdxf· string · optionnel
check:'dfm-preflight' — path to a DXF file.code· string · optionnel
Inline kernelCAD script source (same checks as `file`).file· string · optionnel
Path to a .kcad.ts script (assembly/dfm/dfm-preflight/swept-collision/reachable/mounting-holes/load-capacity/static-hold/geometry-quality/edge-radius). Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.mode· string · optionnel · stub | beam | fea
check:'load-capacity' — 'beam' (default), 'stub', or 'fea' (solve the script's feaStudy: CalculiX + gmsh when installed, else the in-process voxel estimate).pose· object|array · optionnel
check:'static-hold' — explicit pose (joint name -> deg/mm) or array of poses; omit to sample a grid across the evaluated joint's range.seed· object · optionnel
check:'reachable' — numeric IK seed pose (joint name -> deg/mm).check· string · requis · assembly | urdf | dfm | dfm-preflight | swept-collision | reachable | mounting-holes | load-capacity
Which verification to run.edges· object|array|string · optionnel
check:'edge-radius' — EdgeQuery or @kc[...] edge ref(s); intersected with faces. Query near sorts, it does not filter.faces· object|array|string · optionnel
check:'edge-radius' — FaceQuery or @kc[...] face ref(s); includes incident edges and fillets on selected faces.joint· string · optionnel
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.loads· object · optionnel
check:'load-capacity' — partName -> { force?: [Fx,Fy,Fz] N, torque?: [Tx,Ty,Tz] N*m }.parts· array · optionnel
check:'edge-radius' — explicit assembly part names (default all).range· array · optionnel
check:'swept-collision' — [lower, upper, step] in joint-native units.study· string · optionnel
check:'load-capacity' mode:'fea' — feaStudy name (default: the last declared one).refine· boolean · optionnel
check:'load-capacity' mode:'fea' — one automatic finer pass (0.75x element size) when the stress is untrusted, inside the element budget (default true); false solves once at the study's meshSize.vendor· string · optionnel
check:'dfm-preflight' — vendor SKU (required for that check).wheels· array · optionnel
check:'body-likeness' — wheel centres + tire radii [{ center:[x,y,z], radius }].gravity· array · optionnel
check:'static-hold' — gravity vector, m/s^2, world frame (default [0, 0, -9.81]).service· string · optionnel · laser | cnc-router | waterjet | bending
check:'dfm-preflight' — service.assembly· string · optionnel
Assembly name; defaults to the first captured assembly.heatmaps· boolean · optionnel
check:'load-capacity' mode:'fea' — also render stress heatmap PNGs (default false).material· string · optionnel
check:'dfm-preflight' — material SKU (required for that check).supports· object · optionnel
check:'motion-load' — mechanicalJoint name -> support part names to use instead of the declared supports (compare with / without a bushing).tip_link· string · optionnel
check:'reachable' — end-effector part name (required for that check).body_bbox· object · optionnel
check:'body-likeness' — body AABB { min:[x,y,z], max:[x,y,z] } in mm.fasteners· array · optionnel
check:'fastener-installation' — explicit named stations; empty means no coverage.featureId· string · optionnel
check:'dfm-preflight' — FeatureId to scope to.materials· object · optionnel
check:'load-capacity' — partName -> material declaration.mesh_size· number · optionnel
check:'load-capacity' mode:'fea' — element size override, mm.sample_ms· number · optionnel
check:'motion-load' — timeline sample step, ms (default 20). Inertia peaks depend on it at keyframe velocity steps.urdf_path· string · optionnel
check:'urdf' — path to the .urdf file.cabin_bbox· object · optionnel
check:'body-likeness' — optional cabin/greenhouse AABB for automated cabin-aft.directions· array · optionnel
check:'assembly-path' — additional nonzero world-space removal vectors; normalized and deduplicated.feature_id· string · optionnel
check:'geometry-quality' — body feature to measure; defaults to script return. check:'edge-radius' — lowered feature; default the returned model.length_axis· string · optionnel · x | y
check:'body-likeness' — wheelbase axis (default 'x').motion_mode· string · optionnel · tracks | range
check:'motion-load' — 'tracks' (default): along the animationView timeline with inertia; 'range': quasi-static grid over each driven joint's limits.thicknessIn· number · optionnel
check:'dfm-preflight' — material thickness in inches.thicknessMm· number · optionnel
check:'dfm-preflight' — material thickness in millimeters.toleranceMm· number · optionnel
check:'fastener-installation' — linear tolerance, default .05 mm.motion_loads· array · optionnel
check:'motion-load' — external forces: [{ part, point: [x,y,z] mm in the part's modeled frame, force: [Fx,Fy,Fz] N world, fromMs?, toMs? }].quasi_static· boolean · optionnel
check:'motion-load' — drop velocity/acceleration terms (gravity and external loads only).max_radius_mm· number · optionnel
check:'edge-radius' — maximum fillet radius in mm; must be >= min_radius_mm.min_radius_mm· number · optionnel
check:'edge-radius' — minimum fillet radius in mm (does not imply sharp-edge prohibition).prefer_solver· string · optionnel · analytical | numeric | auto
check:'reachable' — force the IK path ('auto' default).range_samples· number · optionnel
check:'static-hold' — grid density per evaluated joint when `pose` is omitted (default 9). check:'motion-load' motion_mode:'range' — grid points per joint (default 5).series_points· number · optionnel
check:'motion-load' — max torque-vs-time points per joint in the result (default 120; 0 omits the series).asserted_plane· object · optionnel
check:'geometry-quality' — optional required mirror plane in model coordinates; normal is normalized and must be nonzero.max_iterations· number · optionnel
check:'reachable' — numeric-path iteration cap.refreshCatalog· boolean · optionnel
check:'dfm-preflight' — force vendor catalog refresh.require_stills· boolean · optionnel
check:'body-likeness' — require still_verdicts (default true).still_verdicts· array · optionnel
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.body_feature_id· string · optionnel
check:'body-likeness' — FeatureId to read body AABB from when body_bbox omitted.target_position· array · optionnel
check:'reachable' — target [x, y, z] mm (world frame).disassemblyOrder· boolean · optionnel
check:'assembly-path' — iteratively remove freed parts and return removalOrder or stuckParts.angleToleranceDeg· number · optionnel
check:'fastener-installation' — axis tilt tolerance, default 1 degree.mesh_deflection_mm· number · optionnel
check:'geometry-quality' — absolute mesh deflection, defaults to tolerance/4; must be <= tolerance/2.require_edge_break· string · optionnel · external | internal | all
check:'edge-radius' — prohibit sharp convex/external, concave/internal, or all edges.target_orientation· array · optionnel
check:'reachable' — target XYZ Euler angles in radians.tiny_face_area_mm2· number · optionnel
check:'geometry-quality' — flag faces strictly below this absolute area; zero disables.tiny_face_relative· number · optionnel
check:'geometry-quality' — fraction of total BREP surface area, ORed with absolute threshold.short_edge_length_mm· number · optionnel
check:'geometry-quality' — flag edges strictly below this length; zero disables.min_torque_margin_pct· number · optionnel
check:'static-hold' — safety-margin floor as a percent of actuator capacity (default 20).position_tolerance_mm· number · optionnel
check:'reachable' — position tolerance in mm.symmetry_tolerance_mm· number · optionnel
check:'geometry-quality' — maximum sampled mirror-to-mesh distance, mm.collision_tolerance_mm3· number · optionnel
check:'swept-collision' — BREP intersection volume tolerance (mm^3).safety_factor_threshold· number · optionnel
check:'load-capacity' — pass/fail safety-factor floor (default 1.5; mode 'fea': the study's minSafetyFactor when declared).orientation_tolerance_rad· number · optionnel
check:'reachable' — orientation tolerance in radians.
Exemple d'appel{"name": "verify", "arguments": {"check": "assembly"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - why_did_this_fail≈ 229 tokens
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? }.
Paramètres, retour & exemple (3)
Paramètrescode· string · optionnelfile· string · optionnel
Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.feature_id· string · optionnel
Exemple d'appel{"name": "why_did_this_fail", "arguments": {"code": "texte", "file": "texte", "feature_id": "texte"}}Exemple de retour{"content": [{"type": "text", "text": "…"}]} - write_bom≈ 332 tokens
Use this when you need to merge a LabWired handoff BOM with optional KernelCAD catalog parts, MPNs and pricing, then write CSV or retrieve Sheets-ready rows. Pass exactly one of handoff, handoff_json or handoff_path. This tool only writes a CSV locally; it makes no Google API calls. Returns headers, tabular rows, CSV contents and the CSV path.
Paramètres, retour & exemple (6)
Paramètreshandoff· object · optionnel
Handoff object with a parts array.overwrite· boolean · optionnel
Set true to replace an existing CSV destination. Existing files are otherwise preserved.output_path· string · optionnel
Optional CSV destination. Defaults to artifacts/bom/bom-<id>.csv.handoff_json· string · optionnel
Handoff JSON text.handoff_path· string · optionnel
Path to handoff JSON.catalog_parts· array · optionnel
Optional matching KernelCAD catalog entries with id/ref, partNumber, vendor and price.
Exemple d'appel{"name": "write_bom", "arguments": {"handoff": {}, "overwrite": true, "output_path": "texte", "handoff_json": "texte", "handoff_path": "texte", "catalog_parts": []}}Exemple de retour{"content": [{"type": "text", "text": "…"}]}
C'est votre serveur ?
Revendiquez-le sur l'espace créateur (preuve GitHub, domaine ou npm) pour afficher le badge « propriétaire vérifié » et lancer un pentest comportemental à la demande afin d'obtenir le badge « Vérifié ».