SCB Sweden Table Query
scb.tables.queryQuery SCB tables by specifying dimension filters for region, age, sex, or year. Returns JSON-stat2 format with labeled dimensions and numeric values.
Instructions
Run a statistical query against an SCB table — specify dimension filters to slice data by region, age, sex, year, etc. Returns JSON-stat2 format with labeled dimensions and numeric values. Always call scb.table_metadata first to discover valid dimension codes and value codes. Example: Sweden total population (Region='00', filter='vs:RegionRiket99'), latest year (Tid filter='top' values=['1']).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_path | Yes | Full path to the leaf table to query — same as scb.table_metadata table_path. Example: 'BE/BE0101/BE0101A/BefolkningNy'. | |
| query | Yes | Array of dimension filters. Each filter selects which values to include for one dimension. Example: [{code:'Region',selection:{filter:'vs:RegionRiket99',values:['00']}}, {code:'ContentsCode',selection:{filter:'item',values:['BE0101N1']}}, {code:'Tid',selection:{filter:'top',values:['1']}}]. Response is JSON-stat2 format with dimension labels and numeric values array. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | Tool response payload. Shape varies per tool — consult the tool description and inputSchema. May be an object, array, string, or number depending on the upstream provider response. | |
| error | No | Present only when the call failed. Includes error code, message, request_id, and any provider-specific extras. |