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

NameTypeRequiredDescription
dataset_idstringyesONS dataset ID
editionstringyesEdition label
versionstringyesVersion
dimensionsobjectyesDimension code → value (or ”*” for all). Example: {“geography”:“K02000001”,“time”:“2023”}.
Exampleunknownno

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

FieldTypeDescription
dataset_idstringDataset ID
editionstringEdition label
versionstringVersion
total_observationsinteger | nullTotal number of observations
unit_of_measurestring | nullUnit of measurement
notesarrayUsage notes
observationsarrayObservation 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.

Regenerated from source · build July 6, 2026