Inspect Model
inspectUse 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, analytic planar/cylindrical faces, hole axes, and conservative hole/pocket/boss/slot/round candidates with per-feature status/confidence.
'brep' — the same recognition report for a native OCCT BREP file, including BRepCheck validity per solid.
'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' — declared mates and limits. code/file captures the supplied source atomically. Optional query:{poses} adds solution from the mate solver and makes ok reflect convergence. evaluationEvidence binds exact source bytes and query inputs.
'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), declaredstock(bar/plate/blank/filament, mm) whenasm.partset it, 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? } }).
stackscans evenly spaced slices and returnsminAreaIndex/minAreaPosition— use it to find the neck/thinnest cross-section along an axis.'continuity' — sampled G0/G1/G2 classification of shared edges ({ feature_id?, edges? }); returns the 9-station method, position/normal/curvature tolerances, edge-frame curvature comparability, worst sample, and explicitly marks G3/G4 as unmeasured. G2 describes the sampled BREP seam result, not the requested feature option.
'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
ofare subject-specific and forwarded verbatim. Most subjects accept { file | code }. Iterating on a saved project: pass file "project:" pluspatch([{ old, new }], each old exactly once) instead of resending the script; nothing is saved until open_in_studio. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:" from request_upload (when the file is on the user's device).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"of": "<of>"
},
"name": "inspect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | of:'section' — single slice position along `axis` (mm). | |
| of | Yes | Which facts to read. | |
| axis | No | of:'section' — normal axis for `at` / `stack` (default 'z'). | |
| code | No | Inline kernelCAD script source. | |
| file | No | Path to the subject file: .step/.stp for of:'step', .brep for of:'brep', or a .kcad.ts script for script-backed subjects. Hosted: `code`, `project:<slug>` (head), or a Studio `/p/<slug>?version=N` link (pinned); no local files. Hosted server: pass an https:// URL, a data: URI, or "asset:<id>" from request_upload — not a path on your machine. | |
| edges | No | of:'continuity' — optional EdgeQuery or @kc[...] ref(s) limiting which shared edges are sampled. | |
| faces | No | of:'curvature' — optional FaceQuery or @kc[...] ref(s) limiting which faces are sampled. | |
| patch | No | Edit-and-test in place: use with file "project:<slug>" instead of resending the script. Each { old, new } replaces text that must occur exactly once in the saved source (no match or several matches is an error and nothing runs); edits apply in order. The tool runs on the patched source; nothing is saved and the saved project stays the base for the next call. To keep the change, call open_in_studio with project "<slug>" (no code) right after a successful evaluate_script (it saves that patched source). Not allowed together with `code`. | |
| plane | No | 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 | No | of:'edges'|'faces' — optional EdgeQuery/FaceQuery filter. of:'mates' — optional { poses: { [mateName]: number | [number,number,number] } } to solve the same captured assembly and return solution. code/file binds mate inventory, limits and solution atomically to evaluationEvidence.source.sha256. A non-converging solution makes ok:false. | |
| stack | No | of:'section' — dense scan: `count` slices evenly spaced from `from` to `to` along `axis`; response reports minAreaIndex/minAreaPosition. | |
| density | No | 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 | No | of:'assembly'|'robot'|'bom' — assembly name; defaults to the first captured assembly. | |
| category | No | of:'part-families' — optional top-level category to filter families by. | |
| face_name | No | of:'face-edges' — canonical face name (required for that subject). | |
| feature_id | No | of:'shape'|'mass'|'topology'|'edges'|'faces'|'face-edges'|'face-labels' — FeatureId; defaults to the last returned shape. | |
| spike_factor | No | of:'curvature' — spike sensitivity as a multiple of the face's Gaussian stddev (default 6). | |
| gyration_axis | No | 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||