Full PSGC hierarchy for a place
get_location_hierarchyRetrieve the full administrative hierarchy (region, province, city/municipality, barangay) for a given Philippine Standard Geographic Code.
Instructions
Return the full chain region -> province -> city/municipality -> barangay for one PSGC code.
This tool checks that psgc_code is well-formed before it sends any request. A malformed code never reaches the network. An unknown but well-formed code, or a PSGC mirror outage, both produce an empty chain instead of a match. Check the fields named below to tell the two apart. Examples:
get_location_hierarchy("072217000") Cebu City, chain walks up through province and region get_location_hierarchy("999999999") well-formed but unknown code get_location_hierarchy("not-a-code") malformed, rejected before any network call
On failure, a malformed code returns validation_error: true, data_status "invalid_request", and chain: [], with no network call made. A genuine mirror outage during lookup or the hierarchy walk returns chain: [], upstream_error: true, and the real error in caveats. A clean unknown-code answer returns chain: [] and caveats, with neither key set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| psgc_code | Yes | 9-digit PSGC code (leading zeros optional). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||