get_article_history
Retrieve the complete amendment history of EU regulation articles, including dates and change summaries, to track legislative evolution.
Instructions
Get the full version timeline for a specific article, showing all amendments with dates and change summaries. Premium feature — requires Ansvar Intelligence Portal.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| regulation | Yes | Regulation ID (e.g., "NIS2", "DORA", "GDPR") | |
| article | Yes | Article number (e.g., "21", "6") |
Implementation Reference
- src/tools/version-tracking.ts:72-122 (handler)Implementation of the getArticleHistory tool handler.
export async function getArticleHistory( db: DatabaseAdapter, input: GetArticleHistoryInput, ): Promise<ArticleHistory | { premium: false; message: string }> { if (!isPremiumEnabled()) { return { premium: false, message: PREMIUM_UPGRADE_MESSAGE }; } if (!(await hasVersionsTable(db))) { throw new Error('Version tracking data not available in this database build.'); } const { regulation, article } = input; // Find the parent article const articleResult = await db.query<{ rowid: number }>( 'SELECT rowid FROM articles WHERE regulation = $1 AND article_number = $2', [regulation, article], ); if (articleResult.rows.length === 0) { throw new Error(`Article ${article} not found in ${regulation}`); } const articleId = articleResult.rows[0].rowid; const versions = await db.query<{ effective_date: string | null; superseded_date: string | null; change_summary: string | null; source_url: string | null; }>( `SELECT effective_date, superseded_date, change_summary, source_url FROM article_versions WHERE article_id = $1 ORDER BY effective_date ASC`, [articleId], ); const currentVersion = versions.rows.length > 0 ? versions.rows[versions.rows.length - 1].effective_date : null; return { regulation, article, current_version: currentVersion, versions: versions.rows, }; } - src/tools/version-tracking.ts:8-11 (schema)Input type definition for getArticleHistory.
export interface GetArticleHistoryInput { regulation: string; article: string; }