Just sold a '99 Tacoma with 175,000 miles that would not pass smog due to PO171. Truck runs smooth and gives no indication of vacum leaks. After reading and hearing all sorts of stories I did the following:
Wasted time and money letting Toyota clean the MAF and get the voltage reading correct according to them. Failed again on PO171. They just said.....Sorry.
Then I brought it home and did a complete visual on the engine vacum lines and pulled out the air cleaner box to clean and check for cracks.....non found......went to AutoZone
bought a new sensor for $80 put everything back together and drove the truck for 30 miles mixed freeway and street.
Past smog with no problems same afternoon.
Toyotas seem to get hit hard with this code and you can waste a lot of time chasing it. The above worked for me pretty quickly.