Insert a part into an assembly
insert_instanceInsert a part or whole Part Studio into an Onshape assembly, returning new instance IDs and names for positioning and mating.
Instructions
Insert a part (or a whole Part Studio) into an Assembly and return the new instances' IDs and names. Name the Assembly tab (rename) if it still says 'Assembly N'. Only when the user asks for an assembly. Join parts with add_mate.
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>",
"source_element_id": "<source_element_id>"
},
"name": "insert_instance"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fixed | No | Ground the instance (it cannot move). Usually the first one. | |
| part_id | No | Part ID (list_parts) of the one part to insert. Leave out to insert the whole Part Studio as one instance. | |
| 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. | |
| configuration | No | Variant of a configured Part Studio to insert, e.g. {'Size': 'M18'}. | |
| source_element_id | Yes | Element (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document. | |
| source_document_id | No | Document that holds the Part Studio; defaults to this document. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||