Boolean (union, subtract, intersect)
booleanCombine, cut, or intersect Onshape parts to create merged solids or cutouts; after merging, re-list parts because part IDs change.
Instructions
Combine whole parts: join them (union), cut one with another (subtract: a bolt hole shaped like a part) or keep what they share (intersect). Part IDs change when parts merge, so call list_parts afterwards. The reply says what changed (parts removed, volume).
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": {
"document_id": "<document_id>",
"element_id": "<element_id>",
"operation": "<operation>",
"tools": "<tools>"
},
"name": "boolean"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Feature name (default 'Union'). | |
| tools | Yes | Part IDs (list_parts): everything to union or intersect (two or more), or the cutters of a subtract. | |
| verify | No | Measure the Part Studio before and after (two extra requests) and report what changed: part count and total volume, plus a warning when nothing changed (Onshape can accept a feature that does nothing). Set false to save requests. | |
| targets | No | Subtract only: the part(s) to cut material out of. | |
| operation | Yes | 'union' joins the parts in `tools` into one; 'subtract' cuts the `tools` out of the `targets`; 'intersect' keeps only the volume the `tools` share. | |
| element_id | Yes | Element (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document. | |
| keep_tools | No | Subtract / intersect: keep the tool parts instead of consuming them. | |
| document_id | Yes | Onshape document ID: the 24-character hex string after /documents/ in the document URL. Get it from list_documents. | |
| workspace_id | No | Workspace ID (the string after /w/ in the URL). Optional - defaults to the document's main workspace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||