List variables
list_variablesList Part Studio variables with names, types, expressions, current values, and configuration options so you can reference them as #name in Onshape feature inputs.
Instructions
List the variables of a Part Studio: name, type, the expression it was set with and its current value (lengths in the configured unit, angles in degrees). A variable that depends on a configuration input also shows configured_by and its value per option. Reference a variable as '#name' in sketch sizes, extrude depths, fillet radii, thread pitch, etc.
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": "list_variables"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| element_id | Yes | Element (tab) ID: the string after /e/ in the Onshape URL. Get it from 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 | |||