要 to indicate "will [verb]" vs "need"
要 goes for 将要 or 需要, which indicates will or need.

Normally, 将要 + verb and 需要 + noun.

For distinction, the sentence 我要去北京 goes like this:


我(将)要去北京(了), which indicates 去北京 an action
我(需)要去北京(一趟), which indicates 去北京 an adj and 去北京一趟 a noun


If the tone or the circumstances indicate "I need to go to Beijing (to)", that is only half of the sentence in Chinese, I will ask "to do what". While if it is "I will go to Beijing", the question I will ask is "When". But it is ambiguous indeed without explanation.

Anyway, to be honest, if someone literally says 我要去北京 
The point is 北京, not 要, as all roads lead to Rome.