Geometry Make Part
geometry_make_partBuild a 3D part from a declarative JSON spec and export STEP, GLB, STL or BREP with exact volume, surface area and bounding-box metrics.
Instructions
Build a 3D part from a declarative JSON spec (nothing is executed) and write STEP, optionally GLB, STL and BREP, with exact volume, surface area, bounding-box size and optional mass. Needs the optional cad engine (uv sync --extra cad). The spec is a JSON object with "params" (name: expression, optional) and "features" (a list, at most 200). Every number is a unit string such as "25 mm" or "90 deg"; bare numbers are rejected. "$name" uses an earlier param; an expression may use + - * / ( ) and one plain power of at most 6, e.g. "($L - 2 mm) / 2", at most 200 characters. Features run in order on one solid; the first must be a body with mode "add". Each feature has "op" and an optional "name" (letters, digits, _ and -). Types: L = unit string like "25 mm" or "1.5 in"; V2 = list [L, L]; V3 = list [L, L, L]; POINTS = list of at least 3 V2; A = angle like "90 deg" or "1.57 rad"; AXIS = "+x" "-x" "+y" "-y" "+z" "-z"; MODE = "add" | "cut" | "intersect"; PLANE = "xy" | "xz" | "yz" (sketch axes u, v = x, y | x, z | y, z; normal +z | +y | +x); UV = "u" | "v"; DEPTH = L or "thru"; ENTRIES = list of V3; CBORE = {"diameter": L, "depth": L}; CSINK = {"diameter": L, "angle": A} (included angle); TEXT = short text; SEL = edge selector; FSEL = face selector; INT = whole number; NAME = an earlier feature's name; PATH = file path; SEGS = list of {"to": V2} (line) | {"to": V2, "radius": L, "turn": "left"|"right"="left"} (arc, shorter way; left = counter-clockwise) | {"to": V2, "via": V2} (arc through via); the last to = start. * = required. Ops:
box (body): size* V3, at V3=origin, mode MODE="add". Block; at is its minimum corner.
cylinder (body): diameter* L, height* L, at V3=origin, axis AXIS="+z", mode MODE="add". Round bar from its base centre at, rising along axis.
sphere (body): diameter* L, at V3=origin, mode MODE="add". Ball; at is its centre.
cone (body): diameter* L, top_diameter* L, height* L, at V3=origin, axis AXIS="+z", mode MODE="add". Cone or frustum from its base centre at, rising along axis; top_diameter 0 mm makes a point.
extrude (body): plane PLANE="xy", offset L=0 mm, profile* PROFILE, distance* L, taper A, mode MODE="add". Extrude a 2D profile along the plane normal; a negative distance reverses it; taper (0 to 45 deg) narrows the walls along the extrusion.
import (body): file* PATH, at V3=origin, mode MODE="add". The one solid of a STEP, IGES or BREP file (read in mm), moved by at.
revolve (body): plane PLANE="xy", offset L=0 mm, profile* PROFILE, axis UV="v", angle A=360 deg, mode MODE="add". Turn a profile about the plane's u or v axis through its origin; keep the profile on one side of it.
hole (modifier): at* ENTRIES, axis AXIS="-z", diameter* L, depth DEPTH="thru", counterbore CBORE, countersink CSINK, thread TEXT, fit TEXT. Drill at each entry point along axis; depth counts from the entry; thread and fit are text callouts only.
pattern (modifier): of* NAME, count* INT, step V3, angle A, center V3=origin, axis AXIS="+z". Repeat an earlier body or hole feature (rather than computing copies or rotated outlines by hand) to count instances in all, the original included: linear by step, or polar about axis through center over angle (360 deg = evenly round, less = first to last).
mirror (modifier): plane* PLANE, offset L=0 mm, of NAME. Reflect in a plane (xy: z = offset, xz: y = offset, yz: x = offset) and add it: the whole part so far, or only the feature of.
shell (modifier): faces* FSEL, thickness* L. Hollow the solid: remove the selected faces, walls grow inward.
fillet (modifier): edges* SEL, radius* L. Round the selected edges.
chamfer (modifier): edges* SEL, distance* L. Bevel the selected edges symmetrically. Profiles: {"rect": {size* V2, at V2=[0 mm, 0 mm], centered BOOL=false}} | {"circle": {diameter* L, at V2=[0 mm, 0 mm]}} | {"polygon": {points* POINTS}} | {"slot": {length* L, width* L, at V2=[0 mm, 0 mm], angle A=0 deg}} | {"path": {start* V2, segments* SEGS}} (a rect's at is its minimum corner unless centered). Edge selectors join terms with &: all |x |y |z >x y z <z convex concave line circle. |x = straight edges along x; >x = edges in the +x face of the part's bounding box; convex and concave = outside and inside corners (a cylinder seam is neither). Face selectors (shell): all >x y z <z plane cylinder; >z = the top face. Both accept of:NAME = what the earlier body, hole, pattern or mirror NAME created, e.g. "of:boss & circle". Both union up to 8 groups with lowercase ' or '; & binds tighter; no parentheses. Divide by plain numbers ("$L / 4"), not by lengths. Example: {"params":{"L":"100 mm","W":"50 mm","T":"20 mm","d":"10 mm"},"features":[{"op":"box","name":"body","size":["$L","$W","$T"]},{"op":"hole","name":"bore","at":[["$L / 4","$W / 2","$T"]],"axis":"-z","diameter":"$d","depth":"thru","fit":"H7"},{"op":"fillet","name":"corners","edges":"|z & convex","radius":"2 mm"}]} Errors: input.invalid has details.pointer (e.g. /features/2/diameter) and details.allowed; geometry.empty_selection and geometry.build_failed name the failing feature_index. Also writes .features.json (declared holes, bound to the STEP by sha256) and spec.json.
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": {
"spec": "<spec>"
},
"name": "geometry_make_part"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Product name in the STEP file and stem of the output files: 1 to 64 letters, digits, '_' or '-' | part |
| spec | Yes | Part spec as a JSON string, at most 64 kB: {params, features}. The grammar and an example are in the tool description | |
| density | No | Optional material density with unit, e.g. '2700 kg/m^3'; adds 'mass'. Empty = no mass | |
| formats | No | Comma list of files besides the STEP: 'glb' (one colour: geometry_view colours it and writes a PNG), 'stl', 'brep'. Empty = STEP only | step |
| output_unit | No | Length unit of the results, e.g. 'mm', 'cm', 'inch' | mm |
| mesh_deflection | No | Chord error of the GLB/STL tessellation, 0.001 mm to 100 mm, e.g. '0.01 mm' | 0.01 mm |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | Non-quantity payload (reports, listings) | |
| error | No | ||
| value | No | Primary quantity result | |
| values | No | All named quantity results (includes the primary) | |
| warnings | No | ||
| artifacts | No | ||
| provenance | Yes | What produced the result and from which inputs. | |
| review_status | No | unreviewed |