Skip to main content
Glama

get_recent_changes

Track regulatory updates by retrieving articles modified since a specified date, with change summaries and optional regulation filtering.

Instructions

List all articles that changed since a given date, with change summaries. Optionally filter to a specific regulation. Premium feature — requires Ansvar Intelligence Portal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regulationNoOptional: filter to a specific regulation (e.g., "NIS2")
sinceYesISO date (e.g., "2024-06-01")
limitNoMaximum results (default: 50, max: 200)

Implementation Reference

  • The implementation of the getRecentChanges tool logic, which queries the database for recent changes to articles.
    export async function getRecentChanges(
      db: DatabaseAdapter,
      input: GetRecentChangesInput,
    ): Promise<{ since: string; changes: RecentChange[]; total: number } | { 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, since, limit } = input;
      const effectiveLimit = Math.min(limit ?? 50, 200);
    
      let sql = `
        SELECT
          a.regulation,
          a.article_number AS article,
          v.effective_date,
          v.change_summary,
          v.source_url
        FROM article_versions v
        JOIN articles a ON a.rowid = v.article_id
        WHERE v.effective_date >= $1
      `;
      const params: (string | number)[] = [since];
    
      if (regulation) {
        sql += ` AND a.regulation = $${params.length + 1}`;
        params.push(regulation);
      }
    
      sql += ` ORDER BY v.effective_date DESC LIMIT $${params.length + 1}`;
      params.push(effectiveLimit);
    
      const result = await db.query<RecentChange>(sql, params);
    
      return {
        since,
        changes: result.rows,
        total: result.rows.length,
      };
    }
  • The interface definition for the input to getRecentChanges.
    export interface GetRecentChangesInput {
      regulation?: string;
      since: string;
      limit?: number;
    }
  • The MCP tool registration and invocation logic for 'get_recent_changes'.
    name: 'get_recent_changes',
    description:
      'List all articles that changed since a given date, with change summaries. Optionally filter to a specific regulation. Premium feature — requires Ansvar Intelligence Portal.',
    inputSchema: {
      type: 'object',
      properties: {
        regulation: {
          type: 'string',
          description: 'Optional: filter to a specific regulation (e.g., "NIS2")',
        },
        since: {
          type: 'string',
          description: 'ISO date (e.g., "2024-06-01")',
        },
        limit: {
          type: 'number',
          description: 'Maximum results (default: 50, max: 200)',
        },
      },
      required: ['since'],
    },
    handler: async (db, args) => {
      const input = args as unknown as GetRecentChangesInput;
      return await getRecentChanges(db, input);
    },

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ansvar-Systems/eu-regulations'

If you have feedback or need assistance with the MCP directory API, please join our Discord server