The sword fragment is a quest item used during the Another Slice of H.A.M. quest. It is one of the six artefacts obtained during the first stage of the quest by digging in the unfinished train tunnel in Dorgesh-Kaan using a trowel.
When the artefacts are cleaned using a specimen brush one of them will turn into the sword fragment. This must be given to Tegdak the goblin along with the other cleaned artefacts (a helmet fragment, an armour shard, a shield fragment and an ancient mace).