In the context of RobotLocomotion/drake#20797, it would be helpful to allow programmatic remote control over the folder state.
One way to offer that would be a property message:
{
"type": "set_property",
"path": "/drake",
"property": "folder_open",
"value": true
}
When the value is true we'd call folder.open(), for false we'd call folder.close().