If you have a contraption x, you can obtain the contraption's prototype as "x.def" and the name of the contraption's prototype as "x.def.name"
Thank you! I have improved it!