Checking type of a mesh. e.g. Box, Sphere

Is there any way I could get the type of mesh?
For example, Box or Sphere.

Nope, not really. You can assume certain things about a certain mesh or could analyze the vertex data (not easy), but we don’t save the type of mesh in the mesh itself.