UNPKG

uk_ons_mcp_server

Version:

MCP server for UK Office for National Statistics (ONS) API - providing access to UK government statistics

109 lines 2.82 kB
export interface ONSDataset { id: string; title: string; description: string; links: { self: { href: string; }; latest_version: { href: string; }; editions: { href: string; }; }; state: string; type: string; uri: string; qmi?: { href: string; title: string; }; methodology?: { href: string; title: string; }; contacts?: Array<{ email: string; name: string; telephone: string; }>; dimensions?: Array<{ id: string; name: string; label: string; links: { options: { href: string; }; self: { href: string; }; }; }>; } export interface ONSDatasetList { count: number; items: ONSDataset[]; limit: number; offset: number; total_count: number; } export interface ONSObservation { dimensions: Record<string, string>; observation: string; metadata?: Record<string, any>; } export interface ONSObservationResponse { observations: ONSObservation[]; dimensions: Record<string, any>; links: Record<string, any>; total_observations: number; } export declare class ONSApiClient { private client; private baseUrl; constructor(); /** * List all available datasets */ listDatasets(limit?: number, offset?: number): Promise<ONSDatasetList>; /** * Get detailed information about a specific dataset */ getDataset(datasetId: string): Promise<ONSDataset>; /** * Get the latest version of a dataset */ getLatestVersion(datasetId: string, edition?: string): Promise<any>; /** * Get observations for a dataset with specific dimensions */ getObservations(datasetId: string, edition: string | undefined, version: string | undefined, dimensions: Record<string, string>): Promise<ONSObservationResponse>; /** * Get CSV download URL for a dataset */ getDownloadUrl(datasetId: string, edition?: string): Promise<string>; /** * Search datasets (simple text search across titles and descriptions) */ searchDatasets(query: string, limit?: number): Promise<ONSDatasetList>; /** * Get popular/commonly used datasets */ getPopularDatasets(): string[]; /** * Get dimensions for a dataset */ getDatasetDimensions(datasetId: string): Promise<any>; /** * Get dimension options for a specific dimension */ getDimensionOptions(datasetId: string, dimensionId: string): Promise<any>; /** * Health check - verify API is accessible */ healthCheck(): Promise<boolean>; } //# sourceMappingURL=ons-client.d.ts.map