I want to read my Msbuild path from my self hosted build agent as system defined capabilities, is there any way out to do so ?
You can get that information by leveraging the Agents - Get API call and specifying includeCapabilities=true
on the parameter list.
Worth noting that if you add new capabilities (like installing nodejs for example), you will have to restart the agent for the capabilities to show available.