get_observations
Pack: uk-ons · Endpoint: https://gateway.pipeworx.io/uk-ons/mcp
Fetch observations from a dataset/edition/version. Pass dimension filters as dimensions map ({“geography”: “K02000001”, “time”: “2023”}). Use * for “all values” within a dimension.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
dataset_id | string | yes | ONS dataset ID |
edition | string | yes | Edition label |
version | string | yes | Version |
dimensions | object | yes | Dimension code → value (or ”*” for all). Example: {“geography”:“K02000001”,“time”:“2023”}. |
Example | unknown | no |
Example call
Arguments
{
"dataset_id": "cpih01",
"edition": "time-series",
"version": "1",
"dimensions": {
"geography": "K02000001",
"time": "2023"
}
}
curl
curl -X POST https://gateway.pipeworx.io/uk-ons/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_observations","arguments":{"dataset_id":"cpih01","edition":"time-series","version":"1","dimensions":{"geography":"K02000001","time":"2023"}}}}'
TypeScript (@pipeworx/sdk)
import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();
const result = await pipeworx.call('get_observations', {
"dataset_id": "cpih01",
"edition": "time-series",
"version": "1",
"dimensions": {
"geography": "K02000001",
"time": "2023"
}
});
More examples
{
"dataset_id": "ashe-table-1",
"edition": "annual",
"version": "2",
"dimensions": {
"geography": "*",
"time": "2023"
}
}
Response shape
Always returns: dataset_id, edition, version, total_observations, unit_of_measure, notes, observations
| Field | Type | Description |
|---|---|---|
dataset_id | string | Dataset ID |
edition | string | Edition label |
version | string | Version |
total_observations | integer | null | Total number of observations |
unit_of_measure | string | null | Unit of measurement |
notes | array | Usage notes |
observations | array | Observation rows |
Full JSON Schema
{
"type": "object",
"properties": {
"dataset_id": {
"type": "string",
"description": "Dataset ID"
},
"edition": {
"type": "string",
"description": "Edition label"
},
"version": {
"type": "string",
"description": "Version"
},
"total_observations": {
"type": [
"integer",
"null"
],
"description": "Total number of observations"
},
"unit_of_measure": {
"type": [
"string",
"null"
],
"description": "Unit of measurement"
},
"notes": {
"type": "array",
"description": "Usage notes",
"items": {
"type": "string"
}
},
"observations": {
"type": "array",
"description": "Observation rows",
"items": {
"type": "object",
"properties": {
"value": {
"type": [
"string",
"null"
],
"description": "Observation value"
},
"dimensions": {
"type": "object",
"description": "Dimension codes and labels for this observation",
"additionalProperties": {
"type": "object",
"properties": {
"id": {
"type": [
"string",
"null"
],
"description": "Dimension value ID"
},
"label": {
"type": [
"string",
"null"
],
"description": "Dimension value label"
}
}
}
}
}
}
}
},
"required": [
"dataset_id",
"edition",
"version",
"total_observations",
"unit_of_measure",
"notes",
"observations"
]
}
Connect
Add this to your MCP client config, or use one-click install buttons:
{
"mcpServers": {
"uk-ons": {
"url": "https://gateway.pipeworx.io/uk-ons/mcp"
}
}
}
See Getting Started for client-specific install steps.