Skip to main content
Glama

diff_article

Read-only

Compare EU regulation article versions between dates to identify changes with unified diffs and AI-generated summaries. Requires Ansvar Intelligence Portal.

Instructions

Show what changed in a specific article between two dates, including a unified diff and AI-generated change summary. Premium feature — requires Ansvar Intelligence Portal.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regulationYesRegulation ID (e.g., "NIS2", "DORA", "GDPR")
articleYesArticle number (e.g., "21", "6")
from_dateYesISO date to diff from (e.g., "2024-01-01")
to_dateNoISO date to diff to (defaults to today)

Implementation Reference

  • The handler implementation for diff_article tool.
    export async function diffArticle(
      db: DatabaseAdapter,
      input: DiffArticleInput,
    ): Promise<ArticleDiff | { 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, from_date, to_date } = input;
      const effectiveToDate = to_date ?? new Date().toISOString().slice(0, 10);
    
      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;
    
      // Find the version closest to the to_date that has a diff
      const diffResult = await db.query<{
        diff_from_previous: string | null;
        change_summary: string | null;
        effective_date: string | null;
      }>(
        `SELECT diff_from_previous, change_summary, effective_date
         FROM article_versions
         WHERE article_id = $1
           AND effective_date > $2
           AND effective_date <= $3
         ORDER BY effective_date DESC
         LIMIT 1`,
        [articleId, from_date, effectiveToDate],
      );
    
      if (diffResult.rows.length === 0) {
        return {
          regulation,
          article,
          from_date,
          to_date: effectiveToDate,
          diff: null,
          change_summary: 'No changes found in this date range.',
        };
      }
    
      const row = diffResult.rows[0];
      return {
        regulation,
        article,
        from_date,
        to_date: effectiveToDate,
        diff: row.diff_from_previous,
        change_summary: row.change_summary,
      };
    }
  • Input schema definition for diff_article.
    export interface DiffArticleInput {
      regulation: string;
      article: string;
      from_date: string;
      to_date?: string;
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations confirm read-only/non-destructive status. The description adds valuable behavioral context not in structured fields: the output format ('unified diff and AI-generated change summary') and licensing requirements ('requires Ansvar Intelligence Portal'). No contradictions with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with zero waste. The first sentence front-loads the core purpose and output format. The second sentence provides critical licensing context. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite lacking an output schema, the description adequately describes the return value (unified diff + AI summary). Combined with complete input schema coverage, safety annotations, and the premium feature warning, the description provides sufficient context for a read-only diff tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the baseline score is 3. The description implicitly reinforces the date parameters ('between two dates') and the article targeting ('specific article'), but does not add syntax details, examples, or semantics beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verbs ('Show what changed') and clearly identifies the resource (a specific article between two dates). It distinguishes from siblings like get_article (current state) and get_recent_changes (broad recent changes) by specifying the diff functionality and output format ('unified diff and AI-generated change summary').

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides an important prerequisite ('Premium feature — requires Ansvar Intelligence Portal'), but lacks explicit guidance on when to use this versus similar siblings like get_article_history or compare_requirements. Usage is implied by the date-range diff functionality, but no alternatives are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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