MCPサーバー

ABS Data (observed)

io.github.SamJB123/abs-data
データ・分析 公開・接続可能 MCP 2025-11-25

このMCPでできること

Searches, describes, retrieves, and analyzes Australian Bureau of Statistics statistical tables and observations.

describe_table
Describe a table
A table's dimensions in key order, its coverage dates, and its observed options. Dimensions with up to 64 options list them inline with labels; larger ones (geography, occupations) say how many and are searchable with search_options.
入力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['table'], 'properties': {'table': {'type': 'string', 'minLength': 1, 'description': 'Dataflow id, e.g. CPI'}}}
出力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['table', 'dimensions', 'keyFormat', 'exampleUrl', 'provenance'], 'properties': {'table': {'type': 'object', 'required': ['id', 'name', 'seriesCount', 'frequencies', 'coverage', 'density', 'family', 'geography', 'dimensions', 'topics'], 'properties': {'id': {'type': 'string', 'description': 'Dataflow id, e.g. CPI'}, 'name': {'type': ['string', 'null']}, 'family': {'type': ['string', 'null'], 'description': 'Census table family, e.g. C21_G01'}, 'topics': {'type': 'array', 'items': {'type': 'string'}}, 'density': {'type': ['number', 'null']}, 'coverage': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': ['string', 'null'], 'description': 'Latest observed period'}, 'from': {'type': ['string', 'null'], 'description': 'Earliest observed period, e.g. 2002-Q1'}}, 'additionalProperties': False}, 'geography': {'type': ['string', 'null'], 'description': 'Geography level for family members, e.g. LGA'}, 'dimensions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Dimension ids in key order'}, 'description': {'type': ['string', 'null'], 'description': "ABS's own description, trimmed"}, 'frequencies': {'type': 'array', 'items': {'enum': ['A', 'S', 'Q', 'M', 'W', 'D'], 'type': 'string', 'description': 'A annual, S semi-annual, Q quarterly, M monthly, W weekly, D daily'}}, 'seriesCount': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'Series confirmed to exist by retrieval'}, 'matchedOptions': {'type': 'array', 'items': {'type': 'object', 'required': ['dimension', 'code', 'label'], 'properties': {'code': {'type': 'string'}, 'label': {'type': ['string', 'null']}, 'dimension': {'type': 'string'}}, 'additionalProperties': False}}, 'familyGeographies': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}, 'keyFormat': {'type': 'string', 'description': "Dimension ids joined by '.', the order a selection is serialised in"}, 'dimensions': {'type': 'array', 'items': {'type': 'object', 'required': ['id', 'position', 'codelist', 'optionCount'], 'properties': {'id': {'type': 'string'}, 'options': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'label'], 'properties': {'code': {'type': 'string'}, 'label': {'type': ['string', 'null']}, 'parent': {'type': ['string', 'null']}}, 'additionalProperties': False}}, 'codelist': {'type': ['string', 'null']}, 'position': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991}, 'optionCount': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991}, 'determinedBy': {'type': ['string', 'null']}}, 'additionalProperties': False}}, 'exampleUrl': {'type': 'string', 'format': 'uri'}, 'provenance': {'type': 'object', 'required': ['runId', 'observedAt'], 'properties': {'runId': {'type': 'string'}, 'observedAt': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}
execute
Fetch and analyse data by writing code
Run JavaScript in an isolated sandbox whose only capability is `abs`, a client with the same four verbs as this server (searchTables, describeTable, searchOptions, getData) and the same guarantees: every selection is verified against ABS before fetching. Use it for multi-series or multi-table analysis — fetch several series, compute growth rates, rank capitals, join tables — and `return` only the computed result, so large payloads never reach the conversation. No network beyond `abs`. Budgets: 10s CPU, 50 calls, 25s wall clock, 200KB result. Your code runs inside an async function; use `await`; console.log is captured. // The `abs` object available in execute(): interface Abs { searchTables(input: { query?: string; geography?: string; frequency?: "A"|"S"|"Q"|"M"|"W"|"D"; limit?: number }): Promise<{ results: TableSummary[]; total: number }>; describeTable(table: string): Promise<{ table: TableSummary; dimensions: { id: string; position: number; optionCount: number; options?: { code: string; label: string|null }[] }[]; keyFormat: string }>; searchOptions(input: { table: string; dimension: string; query: string; limit?: number }): Promise<{ options: { code: string; label: string|null; parent?: string|null }[]; total: number }>; getData(input: { table: string; select?: Record<string, string|string[]>; startPeriod?: string; endPeriod?: string; lastN?: number; firstN?: number; maxRows?: number }): Promise<{ key: string; rows: { series: string; period: string; value: number|null; unit?: string|null }[]; rowsReturned: number; truncated: boolean; seriesMatched: number; fullDataUrl: string }>; } interface TableSummary { id: string; name: string|null; seriesCount: number; frequencies: string[]; coverage: { from: string|null; to: string|null }; dimensions: string[]; family: string|null; geography: string|null; matchedOptions?: { dimension: string; code: string; label: string|null }[] } // getData throws an Error whose message is JSON: { reason, dimension, message, validOptions?, alternatives? } — catch it, read validOptions, correct and retry.
入力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['code'], 'properties': {'code': {'type': 'string', 'maxLength': 20000, 'minLength': 1, 'description': 'JavaScript. `abs` is in scope. Must return a value.'}}}
出力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['ok', 'logs'], 'properties': {'ok': {'type': 'boolean'}, 'logs': {'type': 'array', 'items': {'type': 'string'}}, 'error': {'type': 'string'}, 'result': {}, 'truncated': {'type': 'boolean'}}, 'additionalProperties': False}
get_data
Get data
Fetch observations. `select` maps dimension ids to option codes or labels (several allowed); omitted dimensions match everything. The selection is verified live against ABS before fetching, so a call that succeeds always returns real data. Returns up to maxRows observations (default 500, most recent 12 periods per series unless a period range is given), a summary, and the URL for the complete pull. If an option or combination does not exist you are asked to choose from the valid ones.
入力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['table'], 'properties': {'lastN': {'type': 'integer', 'maximum': 1000, 'minimum': 1, 'description': 'Most recent N observations per series; default 12 when no period is given'}, 'table': {'type': 'string', 'minLength': 1}, 'firstN': {'type': 'integer', 'maximum': 1000, 'minimum': 1}, 'select': {'type': 'object', 'default': {}, 'description': 'dimension id -> option code or label (or several). Omitted dimensions match everything.', 'propertyNames': {'type': 'string'}, 'additionalProperties': {'anyOf': [{'type': 'string'}, {'type': 'array', 'items': {'type': 'string'}, 'minItems': 1}]}}, 'maxRows': {'type': 'integer', 'default': 500, 'maximum': 2000, 'minimum': 1, 'description': 'Cap on returned observations'}, 'endPeriod': {'type': 'string'}, 'startPeriod': {'type': 'string', 'description': 'e.g. 2020, 2020-Q1, 2020-03'}}}
出力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['table', 'key', 'seriesMatched', 'rows', 'rowsReturned', 'truncated', 'periodRange', 'fullDataUrl', 'availabilityUrl', 'provenance'], 'properties': {'key': {'type': 'string', 'description': 'The resolved selection as an SDMX key'}, 'rows': {'type': 'array', 'items': {'type': 'object', 'required': ['series', 'period', 'value'], 'properties': {'unit': {'type': ['string', 'null']}, 'value': {'type': ['number', 'null']}, 'period': {'type': 'string'}, 'series': {'type': 'string', 'description': 'The series key, e.g. 1.10001.10.50.Q'}, 'status': {'type': ['string', 'null']}}, 'additionalProperties': False}}, 'table': {'type': 'string'}, 'truncated': {'type': 'boolean'}, 'provenance': {'type': 'object', 'required': ['runId', 'observedAt'], 'properties': {'runId': {'type': 'string'}, 'observedAt': {'type': 'string'}}, 'additionalProperties': False}, 'fullDataUrl': {'type': 'string', 'format': 'uri'}, 'periodRange': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': ['string', 'null'], 'description': 'Latest observed period'}, 'from': {'type': ['string', 'null'], 'description': 'Earliest observed period, e.g. 2002-Q1'}}, 'additionalProperties': False}, 'rowsReturned': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991}, 'seriesMatched': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991}, 'availabilityUrl': {'type': 'string', 'format': 'uri'}}, 'additionalProperties': False}
search
Search the catalogue by writing code
Run JavaScript against the whole catalogue document — every table, its dimensions, coverage and small-dimension options — in an isolated sandbox with no network. Use it to answer questions the fixed verbs make awkward: 'which tables have both an SA2 geography and a quarterly frequency?', 'list every dimension name and how often it appears', 'find codelists whose labels mention rent'. Your code runs inside an async function with `catalogue` in scope; `return` a JSON-serialisable value; console.log output is captured. // The `catalogue` object available in search(): interface Catalogue { provenance: { runId: string; observedAt: string }; corpus: { tables: number; seriesConfirmed: number; seriesImpliedByMetadata: number; density: number }; tables: Record<string, { // keyed by table id, e.g. catalogue.tables.CPI id: string; name: string|null; description: string|null; seriesCount: number; frequencies: string[]; coverage: { from: string|null; to: string|null }; density: number|null; family: string|null; geography: string|null; topics: string[]; dimensions: { id: string; position: number; codelist: string|null; optionCount: number; literal: boolean }[]; }>; options: { literal: Record<string, Record<string, string|null>>; // codelist id -> { code: label } for small codelists (<=64 options) branded: Record<string, number>; // large codelists -> option count (use abs.searchOptions in execute) }; }
入力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['code'], 'properties': {'code': {'type': 'string', 'maxLength': 20000, 'minLength': 1, 'description': 'JavaScript. `catalogue` is in scope. Must return a value.'}}}
出力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['ok', 'logs'], 'properties': {'ok': {'type': 'boolean'}, 'logs': {'type': 'array', 'items': {'type': 'string'}}, 'error': {'type': 'string'}, 'result': {}, 'truncated': {'type': 'boolean'}}, 'additionalProperties': False}
search_options
Search a dimension's options
Find option codes by label text within one dimension of one table — e.g. a suburb name in a geography dimension. Returns codes to use in get_data's select.
入力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['table', 'dimension', 'query'], 'properties': {'limit': {'type': 'integer', 'default': 20, 'maximum': 100, 'minimum': 1}, 'query': {'type': 'string', 'maxLength': 200, 'minLength': 1, 'description': 'Match against option codes and labels'}, 'table': {'type': 'string', 'minLength': 1}, 'dimension': {'type': 'string', 'minLength': 1}}}
出力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['options', 'total', 'provenance'], 'properties': {'total': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991}, 'options': {'type': 'array', 'items': {'type': 'object', 'required': ['code', 'label'], 'properties': {'code': {'type': 'string'}, 'label': {'type': ['string', 'null']}, 'parent': {'type': ['string', 'null']}}, 'additionalProperties': False}}, 'provenance': {'type': 'object', 'required': ['runId', 'observedAt'], 'properties': {'runId': {'type': 'string'}, 'observedAt': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}
search_tables
Search ABS tables
Find ABS statistical tables (dataflows) by topic words, geography level or frequency. Matches table names, topics and dimension names, and also option labels inside dimensions — a search for 'rent' finds CPI through its INDEX option 'Rents' and reports the match in matchedOptions. Census tables published at several geography levels are collapsed to one result with familyGeographies listing the others (use the geography filter to pick one). Every result is confirmed to serve data — nothing here comes from documentation alone. Start here, then describe_table.
入力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'properties': {'limit': {'type': 'integer', 'default': 10, 'maximum': 50, 'minimum': 1}, 'query': {'type': 'string', 'maxLength': 200, 'minLength': 1, 'description': 'Free text over ids, names, topics, dimensions'}, 'frequency': {'enum': ['A', 'S', 'Q', 'M', 'W', 'D'], 'type': 'string', 'description': 'A annual, S semi-annual, Q quarterly, M monthly, W weekly, D daily'}, 'geography': {'type': 'string', 'description': 'Restrict to a geography level, e.g. SA2, LGA'}}}
出力スキーマ
{'type': 'object', '$schema': 'https://json-schema.org/draft/2020-12/schema', 'required': ['results', 'total', 'provenance'], 'properties': {'total': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991}, 'results': {'type': 'array', 'items': {'type': 'object', 'required': ['id', 'name', 'seriesCount', 'frequencies', 'coverage', 'density', 'family', 'geography', 'dimensions', 'topics'], 'properties': {'id': {'type': 'string', 'description': 'Dataflow id, e.g. CPI'}, 'name': {'type': ['string', 'null']}, 'family': {'type': ['string', 'null'], 'description': 'Census table family, e.g. C21_G01'}, 'topics': {'type': 'array', 'items': {'type': 'string'}}, 'density': {'type': ['number', 'null']}, 'coverage': {'type': 'object', 'required': ['from', 'to'], 'properties': {'to': {'type': ['string', 'null'], 'description': 'Latest observed period'}, 'from': {'type': ['string', 'null'], 'description': 'Earliest observed period, e.g. 2002-Q1'}}, 'additionalProperties': False}, 'geography': {'type': ['string', 'null'], 'description': 'Geography level for family members, e.g. LGA'}, 'dimensions': {'type': 'array', 'items': {'type': 'string'}, 'description': 'Dimension ids in key order'}, 'description': {'type': ['string', 'null'], 'description': "ABS's own description, trimmed"}, 'frequencies': {'type': 'array', 'items': {'enum': ['A', 'S', 'Q', 'M', 'W', 'D'], 'type': 'string', 'description': 'A annual, S semi-annual, Q quarterly, M monthly, W weekly, D daily'}}, 'seriesCount': {'type': 'integer', 'maximum': 9007199254740991, 'minimum': -9007199254740991, 'description': 'Series confirmed to exist by retrieval'}, 'matchedOptions': {'type': 'array', 'items': {'type': 'object', 'required': ['dimension', 'code', 'label'], 'properties': {'code': {'type': 'string'}, 'label': {'type': ['string', 'null']}, 'dimension': {'type': 'string'}}, 'additionalProperties': False}}, 'familyGeographies': {'type': 'array', 'items': {'type': 'string'}}}, 'additionalProperties': False}}, 'provenance': {'type': 'object', 'required': ['runId', 'observedAt'], 'properties': {'runId': {'type': 'string'}, 'observedAt': {'type': 'string'}}, 'additionalProperties': False}}, 'additionalProperties': False}
追加
execute
2026年9月17日12:52
追加
search
2026年9月17日12:52
追加
get_data
2026年9月17日12:52
追加
search_options
2026年9月17日12:52
追加
describe_table
2026年9月17日12:52
追加
search_tables
2026年9月17日12:52