Add a mate
add_mateJoin two part instances in an Onshape Assembly with a mate by selecting a spot on each and a mate type, then return the real status and resulting positions.
Instructions
Join two part instances of an Assembly with a mate. Pick a spot on each: for a nut on a bolt use the bolt's circular end edge (at 'center') and a face of the nut (at 'centroid'), with mate_type 'cylindrical' (free to turn and slide) or 'fastened'. The first instance stays where it is if it is grounded; the second moves to satisfy the mate. Returns the real status and both instances' resulting positions. Only when the user asks for an assembly. Note: the centroid of a threaded face can sit ~0.2 mm off the thread's axis.
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>",
"assembly_id": "<assembly_id>",
"mate_type": "<mate_type>",
"first": "<first>",
"second": "<second>"
},
"name": "add_mate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flip | No | Flip the primary axis (the second part faces the other way). | |
| name | No | Defaults to e.g. 'Cylindrical 1'. | |
| first | Yes | ||
| offset | No | [x, y, z] offset between the connectors, in the configured length unit (strings may carry units). | |
| second | Yes | ||
| mate_type | Yes | fastened: no motion; revolute: rotates about the axis; cylindrical: rotates and slides along it (a nut on a bolt); slider, planar, pin_slot, ball, parallel as in Onshape. | |
| assembly_id | Yes | Element ID of the Assembly tab (get_document). | |
| 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 | |||