simplify and generalize tool lookup in plx