The purpose of the sword found in Luke 22:36 was to fullfill prophesy.
And He said to them, “When I sent you out without money belt and bag and sandals, you did not lack anything, did you?” They said, “No, nothing.” And He said to them, “But now, whoever has a money belt is to take it along...