How to merge vertex in StaticMesh

I would like to merge vertices whose coordinates are closest out of the vertices contained in StaticMesh.

Is there such a tool or API?