How can we see what steps are to be run in passed closure object

Since jenkins supports groovy, one can extend own libraries with methods that get closure from the call and use it/apply it eg. within a docker container instantiated by another method within library or using docker plugins/jenkins extensions. That works great.
But how can I extract the code passed within a closure? Simple closureObject.toString() merely reports some node address/specification. To explain why I need it, I need to extract some of the params out of closure’s code to pass them to another method, and I do not have an option to just add extra method where devs could pass closure’s params as separate params and also keep them in the original closure… because there’d be far too much work to be done on the dev teams’ side to actually rewrite their ‘pipeline as code’ code sets. Instead, we need to extract code from the closure, verify nothing bad has crept in, and extract the interesting params for our other library methods once we get the closure. A simple closure code to string extraction would be sufficient for further processing.