better error handling with bad Tools (github #2229)