Is there a general method to solve the equation $P(x_1,x_2,...,x_n)=0$ with $P$ is a polynomial in $n$ variables with integer coefficients and $x_k=\cos(q_k\pi)$ with $q_k$ is a rational number?

This type of equation appears in the problem of classifying all tetrahedra whose dihedral angles are multiples of $\pi$ and I want to know how to solve this kind of problem generally.