Skip to main content
Glama

check_applicability

Read-only

Determine which EU regulations apply to your organization based on sector, size, and location. Get tailored compliance guidance with adjustable detail levels.

Instructions

Determine which EU regulations apply to an organization based on sector and characteristics. Supports tiered detail levels for optimal response length.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sectorYesOrganization sector
subsectorNoOptional: more specific subsector (e.g., "bank", "insurance" for financial)
member_stateNoOptional: EU member state (ISO country code)
sizeNoOptional: organization size
detail_levelNoOptional: level of detail (summary=executive overview only, requirements=include key requirements, full=complete details with basis articles). Default: full

Implementation Reference

  • The main handler function for the `check_applicability` tool, which queries the database for regulations applicable to a given sector, subsector, and entity size, then optionally computes a summary.
    export async function checkApplicability(
      db: DatabaseAdapter,
      input: ApplicabilityInput
    ): Promise<ApplicabilityResult> {
      const VALID_SECTORS: Sector[] = ['financial', 'healthcare', 'energy', 'transport', 'digital_infrastructure', 'public_administration', 'manufacturing', 'other'];
      const { sector, subsector, detail_level = 'full' } = input;
    
      if (!VALID_SECTORS.includes(sector)) {
        throw new Error(`Invalid sector "${sector}". Must be one of: ${VALID_SECTORS.join(', ')}`);
      }
    
      // Query for matching rules - check both sector match and subsector match
      // Note: We handle deduplication in JavaScript, so no need for DISTINCT ON
      let sql = `
        SELECT
          regulation,
          confidence,
          basis_article as basis,
          notes,
          CASE confidence
            WHEN 'definite' THEN 1
            WHEN 'likely' THEN 2
            WHEN 'possible' THEN 3
          END as conf_order
        FROM applicability_rules
        WHERE applies = true
          AND (
            (sector = $1 AND (subsector IS NULL OR subsector = $2))
            OR (sector = $3 AND subsector IS NULL)
          )
        ORDER BY regulation, conf_order
      `;
    
      const result = await db.query(sql, [sector, subsector || '', sector]);
    
      const rows = result.rows as Array<{
        regulation: string;
        confidence: 'definite' | 'likely' | 'possible';
        basis: string | null;
        notes: string | null;
      }>;
    
      // Deduplicate by regulation, keeping highest confidence
      const regulationMap = new Map<string, ApplicableRegulation>();
      for (const row of rows) {
        if (!regulationMap.has(row.regulation)) {
          regulationMap.set(row.regulation, {
            regulation: row.regulation,
            confidence: row.confidence,
            basis: row.basis,
            notes: row.notes,
          });
        }
      }
    
      const applicable_regulations = Array.from(regulationMap.values());
    
      // If summary detail level requested, add summary section
      let summary;
      if (detail_level === 'summary') {
        // Get regulation metadata for summary
        const regIds = applicable_regulations.map(r => r.regulation);
        const placeholders = regIds.map((_, i) => `$${i + 1}`).join(', ');
        const regDataResult = await db.query(
          `SELECT id, full_name, effective_date
           FROM regulations
           WHERE id IN (${placeholders})`,
          regIds
        );
    
        const regData = regDataResult.rows as Array<{
          id: string;
          full_name: string;
          effective_date: string | null;
        }>;
    
        const regMetadata = new Map(regData.map(r => [r.id, r]));
    
        // Priority deadlines for key regulations
        const priorityDeadlines: Record<string, string> = {
          'DORA': 'Jan 17, 2025 (ACTIVE)',
          'NIS2': 'Oct 17, 2024 (Swedish implementation)',
          'AI_ACT': 'Aug 2, 2026 (high-risk systems)',
          'EIDAS2': 'Late 2027 (wallet acceptance)',
          'CSRD': 'Phased 2025-2028',
          'CSDDD': 'Implementation roadmap needed',
        };
    
        const regulations_summary: RegulationSummary[] = applicable_regulations.map(reg => {
          const metadata = regMetadata.get(reg.regulation);
          return {
            id: reg.regulation,
            full_name: metadata?.full_name || reg.regulation,
            confidence: reg.confidence,
            basis: reg.basis,
            notes: reg.notes,
            priority_deadline: priorityDeadlines[reg.regulation],
          };
        });
    
        const by_confidence = {
          definite: applicable_regulations.filter(r => r.confidence === 'definite').length,
          likely: applicable_regulations.filter(r => r.confidence === 'likely').length,
          possible: applicable_regulations.filter(r => r.confidence === 'possible').length,
        };
    
        summary = {
          total_count: applicable_regulations.length,
          by_confidence,
          regulations_summary,
          next_steps: "For detailed requirements, use detail_level='requirements'. For full article-level detail, use detail_level='full'.",
        };
      }
    
      return {
        entity: input,
        applicable_regulations,
        summary,
      };
    }
  • Input schema for the check_applicability tool.
    export interface ApplicabilityInput {
      sector: Sector;
      subsector?: string;
      member_state?: string;
      size?: 'sme' | 'large';
      detail_level?: 'summary' | 'requirements' | 'full';
    }
  • Registration of the 'check_applicability' tool in the tool registry.
    {
      name: 'check_applicability',
      description: 'Determine which EU regulations apply to an organization based on sector and characteristics. Supports tiered detail levels for optimal response length.',
      inputSchema: {
        type: 'object',
        properties: {
          sector: {
            type: 'string',
            enum: ['financial', 'healthcare', 'energy', 'transport', 'digital_infrastructure', 'public_administration', 'manufacturing', 'other'],
            description: 'Organization sector',
          },
          subsector: {
            type: 'string',
            description: 'Optional: more specific subsector (e.g., "bank", "insurance" for financial)',
          },
          member_state: {
            type: 'string',
            description: 'Optional: EU member state (ISO country code)',
          },
          size: {
            type: 'string',
            enum: ['sme', 'large'],
            description: 'Optional: organization size',
          },
          detail_level: {
            type: 'string',
            enum: ['summary', 'requirements', 'full'],
            description: 'Optional: level of detail (summary=executive overview only, requirements=include key requirements, full=complete details with basis articles). Default: full',
          },
        },
        required: ['sector'],
      },
      handler: async (db, args) => {
        const input = args as unknown as ApplicabilityInput;
        return await checkApplicability(db, input);
      },
Behavior3/5

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

Annotations declare readOnlyHint=true. Description adds valuable behavioral context about 'optimal response length' controlling output size. However, with no output schema provided, the description fails to disclose what the tool returns (e.g., list of regulations, applicability scores, compliance gaps).

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. First sentence establishes core purpose; second sentence adds the distinctive feature (tiered detail levels). Front-loaded with the most critical information.

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

Completeness3/5

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

With 100% schema coverage and clear annotations, the description adequately covers inputs. However, given the absence of an output schema and the complexity of EU regulatory applicability, the description should specify the return format (e.g., structured list of regulations with applicability reasoning). Sibling context is also absent.

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?

Schema coverage is 100%, establishing a baseline of 3. Description adds conceptual grouping ('sector and characteristics') and explains the purpose of detail_level ('optimal response length'), but doesn't clarify relationships between parameters (e.g., that subsector depends on sector) or provide format examples beyond schema enums.

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?

Clear verb 'Determine' with specific resource 'EU regulations' and scope 'based on sector and characteristics'. Distinguishes from siblings like get_article or list_regulations by focusing on applicability determination rather than retrieval. However, lacks explicit contrast with search_regulations or list_regulations which also deal with regulation discovery.

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?

Implies usage through explanation of 'tiered detail levels' (suggesting when to use summary vs full), but lacks explicit guidance on when to choose this over siblings like search_regulations or list_regulations. No mention of prerequisites or required context.

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