command to execute these programs then the pipe is managed by a shell, so to get the return code (other than the last one) you need a shell solution.
If you use Bash then you can access the pipe return code using the array PIPESTATUS, recent Korn shell version support one called 'pipefail'.
, and you will find that you don't need tee(1).