| name | kalpataru-examples |
| description | Concrete worked recipes for building canonical shapes in SolidWorks via the Kalpataru MCP — cube, cube-with-hole, cylinder, plate, L-bracket, revolved shaft. Use when the user asks for any of these (or anything similar to them) so the model doesn't have to derive the tool sequence from first principles. |
Worked recipes
If the user's request maps to one of these shapes — or a small variation
of one — follow the exact tool sequence. Don't second-guess the sketch
response: when ready_to_extrude is true, proceed to extrude. Don't
retry creating the sketch.
Cube (NxNxN)
Default N = 50 mm if the user just says "a cube". Adapt N to whatever
size they mention.
1. kalpataru_ping
→ confirms SolidWorks reachable
2. kalpataru_new_part
→ returns document_name
3. kalpataru_create_sketch
plane = "Front"
entities = [
{"type": "rectangle", "center": [0, 0], "width": N, "height": N}
]
→ returns sketch_name = "Sketch1", ready_to_extrude = true
4. kalpataru_extrude
sketch_name = "Sketch1"
depth = N
→ cube appears in SolidWorks viewport
Done. Don't add more steps.
Cube with a through-hole (canonical hello-world)
1. kalpataru_new_part
2. kalpataru_create_sketch
plane = "Front"
entities = [{"type":"rectangle","center":[0,0],"width":50,"height":50}]
3. kalpataru_extrude sketch_name="Sketch1" depth=25
4. kalpataru_query_faces surface="plane" of_feature="Boss-Extrude1"
→ pick the face with the largest +Z centroid (that's the top face)
5. kalpataru_create_sketch
face_id = <top face id, e.g. "F4">
entities = [{"type":"circle","center":[0,0],"diameter":10}]
6. kalpataru_cut sketch_name="Sketch2" depth_type="through_all"
Result: 7 faces (4 sides + annular top + annular bottom + inner cylinder).
Cylinder (diameter D, height H)
1. kalpataru_new_part
2. kalpataru_create_sketch
plane = "Top"
entities = [{"type":"circle","center":[0,0],"diameter":D}]
3. kalpataru_extrude sketch_name="Sketch1" depth=H
Plate / rectangular slab (W x L x T)
1. kalpataru_new_part
2. kalpataru_create_sketch
plane = "Top"
entities = [{"type":"rectangle","center":[0,0],"width":W,"height":L}]
3. kalpataru_extrude sketch_name="Sketch1" depth=T
L-bracket (50 mm legs, 5 mm thick, width W)
1. kalpataru_new_part
2. kalpataru_create_sketch
plane = "Front"
entities = [{
"type": "polyline",
"points": [[0,0],[50,0],[50,5],[5,5],[5,50],[0,50]],
"closed": true
}]
3. kalpataru_extrude
sketch_name = "Sketch1"
depth = W
depth_type = "midplane"
polyline with closed=true auto-coincidents the endpoints. Don't try
to draw 6 separate lines — they won't reliably auto-close.
Hex nut M-N (across-flats AF, thickness T)
1. kalpataru_new_part
2. kalpataru_create_sketch
plane = "Top"
entities = [
{"type":"polygon","center":[0,0],"diameter":AF,"sides":6}
]
3. kalpataru_extrude sketch_name="Sketch1" depth=T
4. kalpataru_query_faces surface="plane" of_feature="Boss-Extrude1"
→ top face = largest +Y centroid (Top plane extrudes along +Y)
5. kalpataru_create_sketch
face_id = <top face id>
entities = [{"type":"circle","center":[0,0],"diameter":N}]
6. kalpataru_cut sketch_name="Sketch2" depth_type="through_all"
Revolved shaft (any stepped axisymmetric part)
Profile must sit entirely in +X (no point at x≤0) and a horizontal
construction line on the X-axis acts as the rotation axis.
1. kalpataru_new_part
2. kalpataru_create_sketch
plane = "Front"
entities = [
{"type":"line","start":[r1, 0], "end":[r1, h1]},
{"type":"line","start":[r1, h1], "end":[r2, h1]},
{"type":"line","start":[r2, h1], "end":[r2, h2]},
# ... close back to the construction line
{"type":"line","start":[r_last, h_last], "end":[r_last, 0]},
{"type":"line","start":[r_last, 0], "end":[r1, 0]},
{"type":"construction_line","start":[-5, 0],"end":[r_last+10, 0]}
]
3. kalpataru_revolve sketch_name="Sketch1" angle=360
For a 2-step shaft (flange 20×10 + shaft 10×40), use the worked example
in examples/integration/revolved_shaft.py as the literal template.
Rules of thumb
- Closed primitives are always closed.
rectangle, circle, polygon,
slot, ellipse — the response will say ready_to_extrude: true.
Proceed to extrude. The legacy bridge sometimes adds confusing
"WARNING: profile NOT closed" text from heartbeat analysis; ignore it
for closed primitives.
- One sketch, one feature. Don't create multiple sketches before
doing the first extrude unless the recipe explicitly calls for it.
- All coordinates are in millimetres.
- Don't pre-dimension a closed primitive — it's already
constrained by its own definition (a rectangle has width/height
baked in; a circle has diameter baked in).
- For cuts, prefer
depth_type="through_all" unless the user
specifies a blind depth — it's the most robust.
- The canonical planes are
"Front" (XY), "Top" (XZ), "Right" (YZ).
Use Front when you want the extrusion to go along +Z, Top for +Y,
Right for +X.