Skip to main content
Glama

list_regulations

Read-only

Browse and explore EU regulations by category or view detailed structures of specific regulations like GDPR, AI Act, and DORA.

Instructions

List available regulations, optionally filtered by category. Without parameters, lists all regulations grouped by category. With a regulation specified, shows chapters and articles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regulationNoOptional: specific regulation to get detailed structure for
categoryNoOptional: filter by category (e.g., "cybersecurity", "financial_services", "data_protection", "ai_and_technology", "product_safety", "sustainability", "healthcare", "critical_infrastructure", "digital_services", "automotive")

Implementation Reference

  • The `listRegulations` function is the core implementation that fetches regulation data from the database, handles filtering by category, and structures the response.
    export async function listRegulations(
      db: DatabaseAdapter,
      input: ListInput
    ): Promise<ListResult> {
      const { regulation, category } = input;
    
      if (regulation) {
        // Get specific regulation with chapters
        const regResult = await db.query(
          `SELECT id, full_name, celex_id, effective_date
           FROM regulations
           WHERE id = $1`,
          [regulation]
        );
    
        if (regResult.rows.length === 0) {
          return { regulations: [] };
        }
    
        const regRow = regResult.rows[0] as {
          id: string;
          full_name: string;
          celex_id: string;
          effective_date: string | null;
        };
    
        // Get articles grouped by chapter
        const articlesResult = await db.query(
          `SELECT article_number, title, chapter
           FROM articles
           WHERE regulation = $1
           ORDER BY article_number::INTEGER`,
          [regulation]
        );
    
        const articles = articlesResult.rows as Array<{
          article_number: string;
          title: string | null;
          chapter: string | null;
        }>;
    
        // Group by chapter
        const chapterMap = new Map<string, Chapter>();
        for (const article of articles) {
          const chapterKey = article.chapter || 'General';
          if (!chapterMap.has(chapterKey)) {
            chapterMap.set(chapterKey, {
              number: chapterKey,
              title: `Chapter ${chapterKey}`,
              articles: [],
            });
          }
          chapterMap.get(chapterKey)!.articles.push(article.article_number);
        }
    
        return {
          regulations: [{
            id: regRow.id,
            full_name: regRow.full_name,
            celex_id: regRow.celex_id,
            effective_date: regRow.effective_date,
            article_count: articles.length,
            chapters: Array.from(chapterMap.values()),
          }],
        };
      }
    
      // List all regulations with article counts
      const result = await db.query(
        `SELECT
          r.id,
          r.full_name,
          r.celex_id,
          r.effective_date,
          COUNT(a.regulation) as article_count
        FROM regulations r
        LEFT JOIN articles a ON a.regulation = r.id
        GROUP BY r.id, r.full_name, r.celex_id, r.effective_date
        ORDER BY r.id`
      );
    
      const rows = result.rows as Array<{
        id: string;
        full_name: string;
        celex_id: string;
        effective_date: string | null;
        article_count: number;
      }>;
    
      const allRegulations = rows.map(row => ({
        id: row.id,
        full_name: row.full_name,
        celex_id: row.celex_id,
        effective_date: row.effective_date,
        article_count: Number(row.article_count),
      }));
    
      // Filter by category if specified
      if (category) {
        const catKey = category.toLowerCase();
        if (!(catKey in REGULATION_CATEGORIES)) {
          const available = Object.keys(REGULATION_CATEGORIES).sort().join(', ');
          return {
            regulations: [],
            category_summary: `Category '${category}' not found. Available categories: ${available}`,
          };
        }
    
        const catIds = new Set(REGULATION_CATEGORIES[catKey]);
        const filtered = allRegulations.filter(r => catIds.has(r.id));
    
        return {
          regulations: filtered,
          category_summary: `${category} (${filtered.length} regulations)`,
        };
      }
    
      // No category filter: return grouped by category
      const regById = new Map(allRegulations.map(r => [r.id, r]));
      const categorized = new Set<string>();
      const lines: string[] = [];
    
      lines.push(`${allRegulations.length} regulations in ${Object.keys(REGULATION_CATEGORIES).length} categories\n`);
    
      for (const [catName, catIds] of Object.entries(REGULATION_CATEGORIES).sort()) {
        const catRegs = catIds
          .filter(id => regById.has(id))
          .map(id => regById.get(id)!);
        if (catRegs.length === 0) continue;
    
        lines.push(`${catName} (${catRegs.length}):`);
        for (const r of catRegs) {
          lines.push(`  ${r.id}: ${r.full_name} (${r.article_count} articles)`);
          categorized.add(r.id);
        }
        lines.push('');
      }
    
      // List uncategorized regulations
      const uncategorized = allRegulations.filter(r => !categorized.has(r.id));
      if (uncategorized.length > 0) {
        lines.push(`other (${uncategorized.length}):`);
        for (const r of uncategorized) {
          lines.push(`  ${r.id}: ${r.full_name} (${r.article_count} articles)`);
        }
      }
    
      return {
        regulations: allRegulations,
        category_summary: lines.join('\n'),
      };
    }
  • `ListInput` defines the accepted input parameters (regulation, category) for the tool.
    export interface ListInput {
      regulation?: string;
      category?: string;
    }
  • The `list_regulations` tool is registered here with its definition and calls the `listRegulations` handler.
    name: 'list_regulations',
    description: 'List available regulations, optionally filtered by category. Without parameters, lists all regulations grouped by category. With a regulation specified, shows chapters and articles.',
    inputSchema: {
      type: 'object',
      properties: {
        regulation: {
          type: 'string',
          description: 'Optional: specific regulation to get detailed structure for',
        },
        category: {
          type: 'string',
          description: 'Optional: filter by category (e.g., "cybersecurity", "financial_services", "data_protection", "ai_and_technology", "product_safety", "sustainability", "healthcare", "critical_infrastructure", "digital_services", "automotive")',
        },
      },
    },
    handler: async (db, args) => {
      const input = (args ?? {}) as unknown as ListInput;
      return await listRegulations(db, input);
Behavior3/5

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

Annotations already establish this is read-only and non-destructive. The description adds valuable behavioral context about output structure: results are 'grouped by category' when listing all, and specifying a regulation 'shows chapters and articles.' This compensates somewhat for the missing output schema, though it omits details like pagination or rate limits.

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?

The description is optimally concise with two efficient sentences. It front-loads the primary action ('List available regulations') and immediately qualifies the filtering options. Every word earns its place; there is no redundant or tautological text.

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?

Given this is a read-only listing tool with good annotations and no output schema, the description adequately covers what the agent needs to know: the scope of regulations listed, the grouping logic, and the hierarchical detail available. It could be improved by mentioning pagination or result limits, but it is sufficient for tool selection.

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

Parameters4/5

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

With 100% schema description coverage, the baseline is 3. The description adds functional semantics by explaining the consequence of using each parameter: 'category' filters the list, while 'regulation' switches the output to show detailed structure (chapters/articles). This goes beyond the schema's basic type definitions.

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

Purpose4/5

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

The description clearly states the tool 'List[s] available regulations' with specific verb and resource. It effectively distinguishes two operational modes (listing all vs. showing structure), which implicitly differentiates it from siblings like 'search_regulations' or 'get_article'. However, it does not explicitly name alternative tools to use for different use cases.

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

Usage Guidelines4/5

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

The description provides clear guidance on parameter usage: 'Without parameters, lists all...' versus 'With a regulation specified, shows chapters and articles.' This explains when to use each parameter. It lacks explicit naming of sibling alternatives (e.g., 'use search_regulations for text search'), but the contextual guidance is strong.

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