Encode tool if passed