that function is bugged. to sell your tools and armor you will need them at full strength. However, say if you have 3 diamond pickaxes, but only 1 is at full strength, you can sell all 3 at the same time (and you get payed the amount proportional to the remaining durability)
This is all that I've found, I haven't done heavy testing with it.