You can use [ad_conn subsite_id] to get the ID of the closest subsite package (presumably the main site in your case). So you can call parameter::get -package_id [ad_conn subsite_id] -parameter DefaultMaster to get the default master parameter.
[ad_conn subsite_id]
parameter::get -package_id [ad_conn subsite_id] -parameter DefaultMaster