I have no experience with the D170 but the fenderdeck on mine has maybe 4 10mm nuts to take off under the footrest. Then some more on top.
Mine is real easy to just lift off and then the fuel tank may be even easier.
You will have to be careful with the seat wires or tail light wires if you have any.
My gas tank just sits in there with no bolts at all.
Using a large funnel with a screen is a good idea when filling a tank, plus making sure that all your gas cans are clean to start.
If I ever see trash in the bottom of my gas cans I give them a good cleaning inside also with the water hose.
After it's dry you can rinse it with a cupful of gas to be sure the water is all gone if you wish.
The gas filter is supposed to take care of trash from all this, but if this "debris" you mention is large enough to wedge in the lines it and choke off the flow.
With the tank off and all the lines exposed you can inspect them for cracks, missing parts, whatever.
Have you looked at the JD parts diagrams for yours?
John Deere - Parts Catalog
Search for D170.
Go to the sectional index, then section 30 for fuel and air.