UNPKG

@r-huijts/opentk-mcp

Version:

MCP server for Dutch parliamentary data access via OpenTK

127 lines (126 loc) 3.78 kB
/** * Utility functions for parsing HTML content */ interface DocumentDetails { title: string | null; type: string | null; nummer: string | null; datum: string | null; bijgewerkt: string | null; versie: number | null; directLinkPdf: string | null; tweedekamerLink: string | null; bijlageBij: { title: string | null; nummer: string | null; link: string; } | null; } interface Committee { id: string; name: string; url: string; } interface CommitteeDetails extends Committee { description?: string | null; members?: Array<{ name: string; id: string; party?: string; role?: string; }>; recentActivities?: Array<{ title: string; date: string; url: string; }>; } interface Activity { id: string; title: string; date: string; time?: string; location?: string; committee?: string; url: string; type?: string; } interface VotingResult { id: string; title: string; date: string; result: 'Aangenomen' | 'Verworpen' | 'Ingetrokken' | 'Aangehouden' | string; submitter?: string; votes?: { voor: string[]; tegen: string[]; voorAantal: number; tegenAantal: number; }; url: string; } interface RecentDocument { id: string; title: string; type: string; date: string; updated: string; committee?: string; subject?: string; url: string; } interface BirthdayPerson { id: string; name: string; party?: string; url: string; } interface OverviewData { recentDocuments: RecentDocument[]; birthdays: BirthdayPerson[]; lastUpdated: string; pagination: { currentPage: number; hasMoreDocuments: boolean; totalDocumentsRetrieved: number; }; } export declare function extractDocumentLink(html: string): string | null; export declare function extractDocumentDetailsFromHtml(html: string, baseUrl: string): DocumentDetails | null; /** * Extracts committee information from the committees HTML page * @param html The HTML content of the committees page * @param baseUrl The base URL for resolving relative URLs * @returns Array of committee objects */ export declare function extractCommitteesFromHtml(html: string, baseUrl: string): Committee[]; /** * Extracts detailed committee information from a committee page * @param html The HTML content of the committee page * @param baseUrl The base URL for resolving relative URLs * @returns Committee details object */ export declare function extractCommitteeDetailsFromHtml(html: string, baseUrl: string, committeeId: string): CommitteeDetails | null; /** * Extracts upcoming activities from the activities HTML page * @param html The HTML content of the activities page * @param baseUrl The base URL for resolving relative URLs * @returns Array of activity objects */ export declare function extractActivitiesFromHtml(html: string, baseUrl: string): Activity[]; /** * Extracts voting results from the stemmingen HTML page * @param html The HTML content of the stemmingen page * @param baseUrl The base URL for resolving relative URLs * @returns Array of voting result objects */ export declare function extractVotingResultsFromHtml(html: string, baseUrl: string): VotingResult[]; /** * Extracts overview information from the main tkconv page * @param html The HTML content of the main page * @param baseUrl The base URL for resolving relative URLs * @param page The page number to retrieve (default: 1) * @returns Overview data including recent documents and birthdays */ export declare function extractOverviewFromHtml(html: string, baseUrl: string, page?: number): OverviewData; export {};