latest
Return the most recent data values for a given dataset. Default filters show the national headline figure; override filters to get observations for specific states or causes of death.
Instructions
Return the most recent observation(s) per measure for a dataset.
For transposed time-series tables this trims to the most-recent period. For wide single-year tables (most AIHW datasets) it returns the same shape as get_data — there is only one period in those tables.
When the curated YAML declares a headline_slice, those filter values
are applied automatically so the no-filter call returns ONE canonical
headline row (e.g. HEALTH_EXPENDITURE → national total, all areas, all
sources). User-supplied filters override the headline_slice per-key —
latest("HEALTH_EXPENDITURE", filters={"state": "NSW"}) keeps the
area/source defaults and returns the NSW latest-year total.
Examples: # Latest year of GRIM data for All causes combined resp = await latest("GRIM_DEATHS", filters={"cause_of_death": "All causes combined"})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filters | No | Same filter shape as get_data. Useful for narrowing to one entity. | |
| measures | No | Same as get_data. | |
| dataset_id | Yes | Curated dataset ID. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv | No | ||
| unit | No | ||
| query | No | ||
| stale | No | ||
| period | No | ||
| source | No | Australian Institute of Health and Welfare | |
| records | No | ||
| aihw_url | Yes | Click-through URL for this dataset's source page. aihw-mcp legacy name — prefer source_url (canonical) for new code. Both fields are populated identically. | |
| row_count | No | ||
| dataset_id | Yes | ||
| source_url | Yes | Canonical click-through URL. Same value as aihw_url; both populated for backward compat. | |
| attribution | No | Data sourced from the Australian Institute of Health and Welfare (AIHW) via data.gov.au. Licensed under Creative Commons Attribution 3.0 Australia (CC BY 3.0 AU). https://creativecommons.org/licenses/by/3.0/au/ | |
| dataset_name | Yes | ||
| retrieved_at | Yes | ||
| stale_reason | No | ||
| truncated_at | No | ||
| server_version | No |