After defeating Gyobou Oniwa, you’ll receive the Mechanical Barrel. Bring this item to the Sculptor to unlock the Prosthetic Tool Upgrades. You need to get the “base” tools first like then talk to the Sculptor again to select the upgrade option. You need to spend Sen and required upgrade materials like Scrap Iron, Scrap Magnetite, Black Gunpowder, etc. Upgrade materials can be acquired as world loot or dropped by tough enemies after defeating them for the first time. Consumed materials are gone permanently so choose which upgrades will complement your playstyle.
Once an upgraded version of the tool has been created, it is treated as a separate tool and you can equip it to your arm like any other prosthetic tool. The older/original version of the tool can still be equipped should you wish to. It's recommended to read the upgraded version's new effects such as their "Hold R2" function.
We have questions and answers related to this topic which may also help you: