PH Civic Data
PH civic data + NASA POWER + Open-Meteo + MODIS NDVI + USGS + IBTrACS + World Bank. 17 tools.
Versions
0.1.4latestTools 32
get_data_freshness Server health + data-source catalog probe. Doubles as the canonical version/health endpoint: returns server_version so agents can confirm which release they are talking to. Also returns the full upstream-source catalog with cache TTLs, freshness expectations, and licenses — useful when deciding whether a stale cached response is OK or a re-fetch is needed. Returns: server_version, server_name, transport, tool_count, asof, sources (list of {source, source_url, freshness, cache_ttl_seconds, license}), note.
get_latest_earthquakes Get the latest earthquake events from PHIVOLCS. Args: min_magnitude: Minimum magnitude to include (default 1.0). limit: Max events to return (default 20, max 100). region: Filter by PH region/province/city name (partial match). Returns a list of events on success. If the PHIVOLCS upstream is unreachable, returns a dict {results: [], upstream_error: true, caveats} instead of an empty list, so "outage" is never mistaken for "no quakes".
get_earthquake_bulletin Get the full bulletin for a PHIVOLCS earthquake event. Args: bulletin_url: Full URL returned by get_latest_earthquakes.bulletin_url.
get_volcano_status Get current alert level for Philippine volcanoes. Args: volcano_name: e.g. "Mayon", "Taal", "Kanlaon", "Bulusan". None returns all monitored volcanoes with recent bulletins. Returns a list on success. If the WOVODAT bulletin list is unreachable or parses to nothing, returns {results: [], upstream_error: true, caveats}.
get_solar_and_climate Daily solar irradiance + climate variables from NASA POWER for any coordinate. Returns daily all-sky surface shortwave irradiance (kWh/m²/day), 2m temperature (°C), corrected precipitation (mm/day), and 2m wind speed (m/s). Useful for solar energy siting, agricultural planning, and historical climate analysis. Args: latitude: Decimal degrees, WGS84. longitude: Decimal degrees, WGS84. start_date: ISO date string (YYYY-MM-DD). Defaults to 14 days ago. end_date: ISO date string (YYYY-MM-DD). Defaults to today.
get_vegetation_index NASA MODIS MOD13Q1 NDVI + EVI vegetation index at any coordinate. NDVI (Normalized Difference Vegetation Index) ranges -1..1. Higher values indicate denser healthy vegetation. EVI is more sensitive in high-biomass areas. Composite period is 16 days at 250m resolution. Useful for agricultural monitoring, deforestation tracking, drought stress indicators. Args: latitude: Decimal degrees, WGS84. longitude: Decimal degrees, WGS84. start_date: ISO date (YYYY-MM-DD). Defaults to ~90 days ago. end_date: ISO date (YYYY-MM-DD). Defaults to today.
get_weather_forecast Get weather forecast for a Philippine location. Uses PAGASA TenDay API when PAGASA_API_TOKEN is set, Open-Meteo otherwise. Args: location: Municipality, city, or province name. days: Forecast days (1-10, default 3).
get_active_typhoons Get active tropical cyclones in/near the Philippine Area of Responsibility (PAR). Returns empty list if none active. If the PAGASA bulletin page is unreachable, returns {results: [], upstream_error: true, caveats} instead, so an outage is never read as "no active typhoons".
get_weather_alerts Get active PAGASA weather alerts and advisories. The PAGASA homepage embeds alert names ("Heavy Rainfall Warning", "Flood Advisory") in its navigation menu and breadcrumbs as well as in actual active-warning sections. We can reliably detect the "No Active Warnings" state but cannot yet isolate active warnings from chrome text. To avoid fabricated advisories, this tool returns `[]` with a caveat when the page is reachable but the state is ambiguous, and `[]` with the explicit "no active warnings" signal when the homepage says so. For real-time advisories, call `bagong.pagasa.dost.gov.ph` directly. Args: region: e.g. "NCR", "Region VII", "CALABARZON". None returns all.
get_population_stats Philippine population from PSA OpenSTAT (2020 Census). Args: region: e.g. "NCR", "Region VII", "Cordillera Administrative Region". None returns national total. year: Ignored — latest data is 2020 Census; field kept for API stability.
get_poverty_stats Poverty incidence from PSA (latest: 2023 Full-Year). Args: region: PH region (None returns national).
get_inflation_stats Headline consumer-price inflation (year-on-year, all items) from PSA. Source: PSA OpenSTAT Consumer Price Index, 2018-based. The tool discovers the current CPI series by text (never a hardcoded table id) and returns the most recently published month's year-on-year change. Reports the exact reference period — PSA publishes with a lag, so this is the latest available figure, not necessarily the current month. Args: area: Region or "Philippines". None returns the national figure. e.g. "NCR", "Region VII", "Davao Region".
get_labor_stats Key labor-force indicators from the PSA Labor Force Survey. Returns labor-force participation, employment, unemployment, and underemployment rates for the latest published reference period. The PSA key-indicator series is national; a `region` argument is recorded as a caveat because this table has no regional breakdown. Args: region: Accepted for API symmetry. The LFS key-indicator table is national only; passing a region adds an explanatory caveat.
get_health_indicators National health indicators from PSA OpenSTAT (subject 1D). With no argument, returns the curated national headline set (maternal mortality ratio and total fertility rate). Pass a free-text `indicator` to fuzzy-match any table published under the Health subject — the available list is browse-discovered, never hardcoded. Args: indicator: Optional free-text indicator name, e.g. "maternal mortality", "fertility". None returns the default headline set.
get_historical_typhoons_ph Historical tropical cyclone tracks that passed through the Philippine AOR. Sourced from NOAA IBTrACS (International Best Track Archive) — the authoritative global archive for tropical cyclone tracks. Filtered to the Western Pacific basin + coordinates inside the Philippine Area of Responsibility, aggregated per storm. Returns peak intensity, minimum pressure, and track period. Args: year: Season year. None returns recent (last 3 years). limit: Max storms to return (default 30).
get_usgs_earthquakes_ph Philippine-region earthquakes from USGS, cross-reference to PHIVOLCS. Returns events inside the PH bounding box (lat 4..22, lng 115..130) that USGS has catalogued, including international-standard Mww/Mwc magnitudes and depth solutions. Complements PHIVOLCS with global-network analysis. Args: start_date: ISO date (YYYY-MM-DD). Defaults to 30 days ago. end_date: ISO date (YYYY-MM-DD). Defaults to today. min_magnitude: Minimum magnitude (default 4.0 to keep noise low). limit: Max events to return (default 50, USGS hard-caps at 20000).
browse_psa_catalog List one level of the PSA OpenSTAT statistical catalog. OpenSTAT publishes roughly 2,900 tables across 27 subjects. This walks that tree one level at a time so an agent can find a dataset without guessing a table id. Args: path: Relative catalog path such as "1F" or "1F/FY". None or "" returns the 27 top-level subjects. Use the `path` field of an entry from a previous call to go one level deeper. Returns: path, parent_path, entries (each with id, title, type "folder"/"dataset", and the `path` to pass back), folder_count, dataset_count, source, source_url, license, data_retrieved_at, caveats. A `dataset` entry is a `.px` table. Pass its `path` to describe_psa_dataset before calling query_psa_dataset. Folder depth varies by subject, so keep browsing until entries come back as datasets. On upstream failure this returns upstream_error: true with an empty entries list. That means the catalog was unreachable, never that the folder is empty.
describe_psa_dataset Read the dimensions and valid value codes of one PSA OpenSTAT dataset. Call this before query_psa_dataset. The query tool needs an explicit value code for every dimension, and those codes live here. Args: dataset_path: Relative path to a `.px` dataset, e.g. "1F/FY/0011F3DF010.px". Take it from the `path` field of a browse_psa_catalog dataset entry. Returns: dataset_path, title, dimensions (each with code, label, value_count, values [{code, label}], values_truncated, is_time_like), total_cells, max_cells_per_query, time_dimensions, source, source_url, license, data_retrieved_at, caveats. total_cells is the size of the full cube. A query must select down to max_cells_per_query or fewer, so pick explicit codes per dimension.
query_psa_dataset Run one bounded query against a PSA OpenSTAT dataset. Every dimension needs an explicit list of value codes from describe_psa_dataset. That is a hard requirement, not a convention: PXWeb expands an unselected dimension to all of its values, and PSA answers the resulting full-cube request with an HTTP 403. Args: dataset_path: Relative `.px` path, e.g. "1F/FY/0241F3DF013.px". selections: Dimension code -> list of value codes, covering every dimension the dataset declares. "all" and "*" are rejected. Example: {"Year": ["2"], "Major Island Group": ["0", "2"], "Among Families/Population": ["0"]}. max_rows: Cap on returned rows (1-5000, default 500). Returns: dataset_path, title, rows (each with keys {dimension: value_code}, labels {dimension: value_label}, and a numeric or null value), row_count, requested_cells, truncated, reference_period, source, source_url, license, data_retrieved_at, caveats, disclaimer. PSA writes a missing cell as "..", and those come back as null, never zero. A selection error returns validation_error: true; an OpenSTAT outage returns upstream_error: true.
get_air_quality Real-time air quality for a Philippine city via Open-Meteo (no API key). Returns PM2.5, PM10, CO, NO2, SO2, O3 plus European AQI and US AQI with category interpretation. Covers ~80 major PH cities via local coordinate table. For unlisted locations, caller can pass coordinates directly via the latitude/longitude form in a future version. Args: location: City or municipality name (e.g. "Manila", "Cebu City", "Davao").
get_area_profile One-call correlated civic profile for a Philippine location. Resolves the place once to its PSA Standard Geographic Code, then composes demographics (population, poverty), economy (regional inflation, national labor), procurement activity, multi-hazard risk, and the short-range weather outlook — in a single agent turn instead of eight. Adds derived cross-source context (e.g. infrastructure notices per 100k residents) so the caller does not have to normalize raw counts itself. Args: location: Municipality, city, province, or region name. e.g. "Leyte", "Cebu City", "Davao Region", "NCR". Returns: resolved location, demographics, economy, procurement, hazard, weather, derived correlations, per-block reference periods, caveats listing any upstream that failed, and the public-data disclaimer.
assess_area_risk Multi-hazard risk assessment combining PHIVOLCS + PAGASA. Makes parallel upstream calls to PHIVOLCS (earthquakes, volcano alert levels) and PAGASA (active typhoons, weather alerts). Expect 3-6 second response time. Args: location: Municipality, city, or province name. Returns: earthquake_risk_level derived from recent 30-day seismic activity (not an official PHIVOLCS assessment), typhoon signal status, active alerts, elevated volcano alerts (national scope), and caveats describing any failed sub-calls.
flag_infra_anomalies Flag PhilGEPS infrastructure projects that warrant further review by cross-referencing PHIVOLCS earthquakes and PAGASA typhoon footprints. This tool emits heuristic anomaly indicators, not accusations. Every flagged item ships with the rule that fired and a disclaimer noting that patterns may have legitimate explanations. Heuristic rules: - duplicate_titles_same_agency: same agency files multiple notices with effectively identical titles (case-insensitive) within the window - high_cost_no_published_progress: cost_php exceeds min_cost_php. The PhilGEPS open listing publishes no progress data for ANY notice, so this is a cost-threshold transparency flag, not a project-specific "progress is missing" finding. - hazard_overlap: project location keywords overlap with a recent PHIVOLCS earthquake (>=M4.0 in last 30d) or an active PAGASA typhoon footprint, suggesting urgency or post-disaster reconstruction context Args: region: PH region filter for the project list. province: Province filter (partial match). min_cost_php: Threshold for the high_cost_no_published_progress rule (default 50,000,000 PHP). Returns: flagged list with each entry containing project_id, title, agency, rule_fired, evidence, source_url, plus the global disclaimer.
resolve_ph_location Fuzzy-resolve a Philippine place name to its canonical PSGC record. Args: query: Free-text place name. Examples: "Sta. Mesa, Manila", "Cebu City", "NCR", "Pampanga", "Tagaytay". Returns: psgc_code, name, level (region|province|city|municipality|barangay), parent_code, region_name, source_url, license, match_score, alternatives (runner-up candidates for ambiguous names), data_retrieved_at. {"matched": false, "caveats": [...]} when no match; the same shape plus "upstream_error": true when the PSGC API itself was unreachable. Common nicknames resolve directly: "QC", "Gensan", "CDO", "Metro Manila".
list_admin_units Browse children of a PSGC node, or top-level regions when parent_code is None. Args: parent_code: Parent PSGC code. None returns the regions list. level: Filter children by level (region|province|city|municipality|district|barangay). limit: Max units to return (default 50, capped at 500). offset: Skip this many matching units before returning results — page past 500 children (e.g. Manila has 897 barangays) by calling again with offset=500. Returns: list of PSGC records with psgc_code, name, level, parent_code, region_name, source_url, license, source. On PSGC API failure returns {results: [], upstream_error: true, caveats}.
get_location_hierarchy Return the full chain region -> province -> city/municipality -> barangay for one PSGC code. Args: psgc_code: 9-digit PSGC code (leading zeros optional). Returns: psgc_code, chain (list of {psgc_code, name, level, source_url}), source, license, data_retrieved_at.
search_infra_projects Search Philippine government infrastructure projects. Backed by PhilGEPS open notice listing filtered for infra-related work (construction / road / bridge / flood control / drainage / school building / civil works). Source: https://www.philgeps.gov.ph/. Approved budget amounts are not published in the open notice listing, so cost_php is null in most records. The DPWH transparency portal API is currently blocked by Cloudflare and not used. Args: keyword: Title/agency substring (e.g. 'flood control', 'bridge'). region: PH region filter (partial match against agency text). province: Province name filter (partial match). year: Filter publish date to this calendar year. min_cost_php: Minimum approved cost in PHP (filters out null-cost records when set). status: Status filter (partial match, e.g. 'open', 'awarded'). limit: Max results (default 25, capped at 100). Each result: project_id, title, agency, region, province, category, cost_php, currency, progress_pct, funding_source, contractor, status, date_published, award_date, lat, lng, documents, source, source_url, license, data_retrieved_at.
get_infra_project Return the full record for one infrastructure project by project_id. Args: project_id: Reference number from search_infra_projects. Returns: full InfraProject fields (cost_php, progress_pct, funding_source, contractor, lat/lng, documents) where exposed; null where the upstream listing does not publish that field.
summarize_infra_spending Aggregate infrastructure procurement statistics over the latest PhilGEPS window. Args: region: PH region filter (partial match). year: Filter publish date to this calendar year. funding_source: Reserved for future DPWH integration; PhilGEPS notices do not expose funding source, so this filter is a no-op today. Returns: total_count, total_value_php (null where costs not exposed), by_category, by_funding_source, by_region, top_agencies, reference_period, note, source, source_url, license, disclaimer.
search_procurement Search PH government procurement from PhilGEPS open data. Note: the PhilGEPS public portal does not expose server-side search for external clients, so this tool fetches the latest ~100 bid notices and filters them in-memory. Data is cached 6 hours. Keyword/agency/region filters are applied client-side (case-insensitive substring match). Args: keyword: Search term matched against title + agency + classification. agency: Partial match on procuring entity name. region: PH region filter (partial match). date_from / date_to: YYYY-MM-DD bounds on publish date. limit: Max results (default 20, max 100). Returns a list on success. If the PhilGEPS listing is unreachable, returns {results: [], upstream_error: true, caveats} instead of an empty list, so an outage is never read as "no matching notices".
get_procurement_summary Aggregate procurement statistics over the latest notices cached from PhilGEPS. Args: agency: Partial agency match filter. region: PH region filter. year: Filter publish date to this year. Returns: Totals, breakdown by procurement mode, top agencies, reference period.
get_world_bank_indicator World Bank macroeconomic/social indicator for the Philippines. Accepts a World Bank indicator code (e.g. 'NY.GDP.MKTP.CD') or a friendly alias (e.g. 'gdp', 'poverty_ratio', 'inflation', 'urban_population_pct'). Args: indicator: WB code or alias. See INDICATOR_ALIASES in source for the curated list of common indicators. per_page: Number of observations to return (latest first, default 20).
Permissions 4
network medium filesystem low shell high env_vars low