You can completely reconstruct any contraption that is less than 5ft x 5ft. You need a part of the original contraption you're working with, having less parts means taking longer time to reconstruct. You also use scrap metals worth at least 35gp, the more complicated the contraption, the more scrap metals you'll need. If the contraption has magic embed to it, do a DC 15 (spellcasting ability) with the proper modifier. In a success, proceed to make reconstruction. However, in a fail, it will require an extra time of at least 5 mins. The DM will decide how much time it takes, worth/amount of scrap metal, and the extra time given.
While reconstructing, you can make one new modification to the contraption on a successful DC 20 INT check, only have one chance. At a fail, proceed to reconstruct the contraption without any new modifications. You can ask the DM what modification you will make, and he/she can allow it or not.
* - (scraps of any type of metal worth at least 35gp, any part of the original contraption)