@r-huijts/opentk-mcp
Version:
MCP server for Dutch parliamentary data access via OpenTK
87 lines (86 loc) • 2.98 kB
TypeScript
/**
* Service for interacting with the tkconv API
*/
export declare class ApiService {
/**
* Fetches JSON data from the API
* @param path The API path to fetch
* @param options Additional fetch options
* @returns Parsed JSON data
* @throws Error if the request fails or returns HTML
*/
fetchJson<T>(path: string, options?: RequestInit): Promise<T>;
/**
* Fetches HTML content from the API
* @param path The API path to fetch
* @param options Additional fetch options
* @returns HTML content as string
* @throws Error if the request fails
*/
fetchHtml(path: string, options?: RequestInit): Promise<string>;
/**
* Fetches binary data from the API
* @param path The API path to fetch
* @param options Additional fetch options
* @returns Binary data as ArrayBuffer and content type
* @throws Error if the request fails
*/
fetchBinary(path: string, options?: RequestInit): Promise<{
data: ArrayBuffer;
contentType: string;
}>;
/**
* Searches for documents in the tkconv API
* @param query The search query
* @param options Additional options like twomonths flag
* @returns Search results
* @throws Error if the request fails or returns HTML
*/
search<T>(query: string, options?: {
twomonths?: boolean;
soorten?: string;
}): Promise<T>;
/**
* Resolves an external reference to a URL
* @param extId The external ID to resolve
* @returns The resolved URL or empty string if not found
*/
resolveExternal(extId: string): Promise<string>;
/**
* Fetches a sitemap of URLs for a specific time period
* @param path The sitemap path (e.g., sitemap-2025.txt)
* @returns Array of URLs
*/
fetchSitemap(path: string): Promise<string[]>;
/**
* Fetches a list of all current Members of Parliament
* @returns Array of MP data
*/
getPersons(): Promise<any[]>;
/**
* Extracts MP data from the HTML of the kamerleden.html page
* @param html The HTML content of the kamerleden.html page
* @returns Array of MP data
*/
private extractPersonsFromHtml;
/**
* Fetches details for a specific Member of Parliament
* @param id The ID of the MP to fetch
* @returns MP data or null if not found
*/
getPerson(id: number): Promise<any | null>;
/**
* Extracts MP data from the HTML of the persoon.html page
* @param html The HTML content of the persoon.html page
* @param id The ID of the MP
* @returns MP data or null if not found
*/
private extractPersonFromHtml;
/**
* Fetches overview data from the main tkconv page
* @param page The page number to retrieve (default: 1)
* @returns Overview data including recent documents and birthdays
*/
getOverview(page?: number): Promise<any>;
}
export declare const apiService: ApiService;