No, it won't work for Masterwork tools, but it will work for ENCHANTED Masterwork Tools.
OR... Buy Boccob's Blessed Book, have people write important info into it. Swallow it. Become a knowledge god.
PS: Nothing is stopping you from eating the items. You just gain nothing from it. Also, I was going to suggest a Ring of Sustenance. Only because hearing a Tarrasque say "Nah, I'm not hungry" would never stop being funny.