Get assembly
get_assemblyReads an assembly's instances, placements, and mates to verify structure before edits and confirm parts moved after applying mates. Read-only single request; use for instance IDs and mate validation.
Instructions
Read an Assembly tab: what it contains, where everything sits and what is mated. Call it
before changing an assembly (to get the instance IDs add_mate needs after
insert_instance) and after add_mate to confirm a part really moved - an accepted mate
is not proof. Read-only, one request, nothing is changed. It returns instances
(instance_id, name and suppressed; for an inserted single part also type 'Part' and the
part_id and element_id of its source - an instance of a whole Part Studio carries only its
id and name, so those fields are then absent), placements (the instance path, fixed,
and position: the translation of its origin in the configured length unit - rotation is
not reported) and mates (feature_id, name, type, suppressed). An empty assembly gives
empty lists. For the parts of a Part Studio use list_parts; for the tabs of a document
use get_document; for volume or size use get_part_properties on the Part Studio.
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>"
},
"name": "get_assembly"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| element_id | Yes | Element ID of the ASSEMBLY tab (from get_document, type ASSEMBLY). For a Part Studio use list_parts instead. | |
| 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 | |||