Skip to main content
Glama
CSOAI-ORG

NIS2 Compliance MCP

audit_article_21

Audit your current controls against NIS2 Article 21's 10 mandatory risk-management measures to identify gaps, evidence status, and sanction exposure tier.

Instructions

Audit your current controls against NIS2 Article 21's 10 mandatory risk-management measures. Returns per-measure evidence status + gap list + sanction exposure tier.

Behavior: This tool is read-only and stateless — it produces analysis output without modifying any external systems, databases, or files. Safe to call repeatedly with identical inputs (idempotent). Free tier: 10/day rate limit. Pro tier: unlimited. No authentication required for basic usage.

When to use: Use this tool when you need to assess, audit, or verify compliance requirements. Ideal for gap analysis, readiness checks, and generating compliance documentation.

When NOT to use: Do not use as a substitute for qualified legal counsel. This tool provides technical compliance guidance, not legal advice.

Args: entity_description (str): The entity description to analyze or process. current_controls (str): The current controls to analyze or process. api_key (str): The api key to analyze or process.

Behavioral Transparency: - Side Effects: This tool is read-only and produces no side effects. It does not modify any external state, databases, or files. All output is computed in-memory and returned directly to the caller. - Authentication: No authentication required for basic usage. Pro/Enterprise tiers require a valid MEOK API key passed via the MEOK_API_KEY environment variable. - Rate Limits: Free tier: 10 calls/day. Pro tier: unlimited. Rate limit headers are included in responses (X-RateLimit-Remaining, X-RateLimit-Reset). - Error Handling: Returns structured error objects with 'error' key on failure. Never raises unhandled exceptions. Invalid inputs return descriptive validation errors. - Idempotency: Fully idempotent — calling with the same inputs always produces the same output. Safe to retry on timeout or transient failure. - Data Privacy: No input data is stored, logged, or transmitted to external services. All processing happens locally within the MCP server process.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entity_descriptionYes
current_controlsNo
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'audit_article_21' tool. It takes entity_description, current_controls, and api_key, then scores the entity against NIS2 Article 21's 10 risk-management measures using keyword matching. Returns a JSON report with score, pass/fail per measure, gaps, remediation priority, and management body liability note.
    def audit_article_21(entity_description: str, current_controls: str = "", api_key: str = "") -> str:
        """Audit your current controls against NIS2 Article 21's 10 mandatory risk-management measures.
        Returns per-measure evidence status + gap list + sanction exposure tier.
    
        Behavior:
            This tool is read-only and stateless — it produces analysis output
            without modifying any external systems, databases, or files.
            Safe to call repeatedly with identical inputs (idempotent).
            Free tier: 10/day rate limit. Pro tier: unlimited.
            No authentication required for basic usage.
    
        When to use:
            Use this tool when you need to assess, audit, or verify compliance
            requirements. Ideal for gap analysis, readiness checks, and generating
            compliance documentation.
    
        When NOT to use:
            Do not use as a substitute for qualified legal counsel. This tool
            provides technical compliance guidance, not legal advice.
    
        Args:
            entity_description (str): The entity description to analyze or process.
            current_controls (str): The current controls to analyze or process.
            api_key (str): The api key to analyze or process.
    
        Behavioral Transparency:
            - Side Effects: This tool is read-only and produces no side effects. It does not modify
              any external state, databases, or files. All output is computed in-memory and returned
              directly to the caller.
            - Authentication: No authentication required for basic usage. Pro/Enterprise tiers
              require a valid MEOK API key passed via the MEOK_API_KEY environment variable.
            - Rate Limits: Free tier: 10 calls/day. Pro tier: unlimited. Rate limit headers are
              included in responses (X-RateLimit-Remaining, X-RateLimit-Reset).
            - Error Handling: Returns structured error objects with 'error' key on failure.
              Never raises unhandled exceptions. Invalid inputs return descriptive validation errors.
            - Idempotency: Fully idempotent — calling with the same inputs always produces the
              same output. Safe to retry on timeout or transient failure.
            - Data Privacy: No input data is stored, logged, or transmitted to external services.
              All processing happens locally within the MCP server process.
        """
        allowed, msg, tier = check_access(api_key)
        if not allowed:
            return json.dumps({"error": msg, "upgrade_url": UPGRADE_STRIPE_49})
        if err := _check_rate_limit(tier=tier):
            return json.dumps({"error": err, "upgrade_url": UPGRADE_STRIPE_49})
    
        combined = (entity_description + " " + current_controls).lower()
        results = []
        passed = 0
        for n, m in ARTICLE_21_MEASURES.items():
            matched_kws = [kw for kw in m["keywords"] if kw in combined]
            ok = len(matched_kws) > 0
            if ok:
                passed += 1
            results.append({
                "measure": n,
                "name": m["name"],
                "status": "EVIDENCE_FOUND" if ok else "GAP",
                "evidence_signals": matched_kws,
            })
        total = len(ARTICLE_21_MEASURES)
        score = round(passed / total * 100, 1)
        gaps = [r["name"] for r in results if r["status"] == "GAP"]
        return json.dumps({
            "directive": "NIS2 Article 21",
            "score_percent": score,
            "passed": f"{passed}/{total}",
            "assessment": "COMPLIANT" if score >= 70 else "PARTIAL" if score >= 40 else "NON_COMPLIANT",
            "gaps_to_address": gaps,
            "remediation_priority": (
                "CRITICAL — close gaps within 30 days; management body personal liability under Article 20" if score < 40 else
                "HIGH — document evidence + close remaining gaps within 60 days" if score < 70 else
                "MEDIUM — formalise policies, add audit trail"
            ),
            "measures_detail": results,
            "management_body_liability_note": "NIS2 Article 20: management bodies are directly responsible for approving measures AND receive training. National authorities can impose personal liability.",
            "upsell": f"Generate signed governance-accountability evidence pack (Article 20) with Pro tier (£49/mo): {UPGRADE_STRIPE_49}" if tier == "free" else None,
        }, indent=2)
  • server.py:273-274 (registration)
    The tool is registered with MCP via the @mcp.tool() decorator on line 273, which makes 'audit_article_21' discoverable as an MCP tool.
    @mcp.tool()
    def audit_article_21(entity_description: str, current_controls: str = "", api_key: str = "") -> str:
  • The docstring defines the input schema (entity_description: str, current_controls: str, api_key: str) and output behavior for the audit_article_21 tool.
    """Audit your current controls against NIS2 Article 21's 10 mandatory risk-management measures.
    Returns per-measure evidence status + gap list + sanction exposure tier.
    
    Behavior:
        This tool is read-only and stateless — it produces analysis output
        without modifying any external systems, databases, or files.
        Safe to call repeatedly with identical inputs (idempotent).
        Free tier: 10/day rate limit. Pro tier: unlimited.
        No authentication required for basic usage.
    
    When to use:
        Use this tool when you need to assess, audit, or verify compliance
        requirements. Ideal for gap analysis, readiness checks, and generating
        compliance documentation.
    
    When NOT to use:
        Do not use as a substitute for qualified legal counsel. This tool
        provides technical compliance guidance, not legal advice.
    
    Args:
        entity_description (str): The entity description to analyze or process.
        current_controls (str): The current controls to analyze or process.
        api_key (str): The api key to analyze or process.
    
    Behavioral Transparency:
        - Side Effects: This tool is read-only and produces no side effects. It does not modify
          any external state, databases, or files. All output is computed in-memory and returned
          directly to the caller.
        - Authentication: No authentication required for basic usage. Pro/Enterprise tiers
          require a valid MEOK API key passed via the MEOK_API_KEY environment variable.
        - Rate Limits: Free tier: 10 calls/day. Pro tier: unlimited. Rate limit headers are
          included in responses (X-RateLimit-Remaining, X-RateLimit-Reset).
        - Error Handling: Returns structured error objects with 'error' key on failure.
          Never raises unhandled exceptions. Invalid inputs return descriptive validation errors.
        - Idempotency: Fully idempotent — calling with the same inputs always produces the
          same output. Safe to retry on timeout or transient failure.
        - Data Privacy: No input data is stored, logged, or transmitted to external services.
          All processing happens locally within the MCP server process.
    """
  • The ARTICLE_21_MEASURES dictionary defining all 10 NIS2 Article 21 risk-management measures and their associated keywords, used by audit_article_21 to match against user-provided controls.
    ARTICLE_21_MEASURES = {
        1: {"name": "Risk analysis and information system security policies", "keywords": ["risk assessment", "security policy", "policies", "iso 27005"]},
        2: {"name": "Incident handling", "keywords": ["incident response", "ir playbook", "cert", "csirt"]},
        3: {"name": "Business continuity (backups, disaster recovery, crisis management)", "keywords": ["bcp", "dr", "backup", "disaster recovery", "business continuity", "crisis management"]},
        4: {"name": "Supply chain security (direct suppliers + service providers)", "keywords": ["supply chain", "vendor assessment", "tprm", "third party risk", "sbom"]},
        5: {"name": "Security in network and information systems acquisition, development, and maintenance, including vulnerability handling", "keywords": ["secure sdlc", "vulnerability management", "patching", "cve", "sast", "dast"]},
        6: {"name": "Policies and procedures to assess effectiveness of cybersecurity risk-management measures", "keywords": ["audit", "kpi", "metrics", "effectiveness", "maturity model"]},
        7: {"name": "Basic cyber hygiene practices and cybersecurity training", "keywords": ["training", "awareness", "cyber hygiene", "phishing simulation"]},
        8: {"name": "Policies and procedures regarding the use of cryptography and encryption", "keywords": ["encryption", "cryptography", "tls", "aes", "pki", "kms"]},
        9: {"name": "Human resources security, access control policies, and asset management", "keywords": ["iam", "access control", "rbac", "mfa", "sso", "privileged access", "asset inventory"]},
        10: {"name": "Multi-factor or continuous authentication, secured communication (voice/video/text), and secured emergency comms", "keywords": ["mfa", "2fa", "zero trust", "signal", "secure comms", "continuous authentication"]},
    }
Behavior5/5

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

With no annotations provided, the description carries the full burden and fully discloses all relevant behaviors: read-only, stateless, idempotent, rate limits (10/day free), authentication needs (none for basic), error handling, and data privacy. This exceeds requirements.

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

Conciseness3/5

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

The description is well-structured with sections but contains redundancy, notably the 'Behavior' and 'Behavioral Transparency' sections that repeat the same points (read-only, idempotent). This could be condensed without losing information.

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?

The tool has moderate complexity (auditing against NIS2) and an output schema is indicated. The description covers return values (evidence status, gaps, sanction tier), usage guidance, and behavior. However, parameter descriptions are vague, and with 3 parameters (1 required), more specific guidance on entity_description and current_controls would improve completeness.

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

Parameters2/5

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

Schema coverage is 0%, so description must compensate. However, the 'Args' section only restates parameter names and types generically (e.g., 'The entity description to analyze') without explaining expected formats, examples, or constraints. This adds little value beyond the schema.

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 clearly states the tool audits controls against NIS2 Article 21's 10 measures. The verb 'audit' and resource 'controls against NIS2 Article 21 measures' are specific, and sibling tools like classify_entity or enforce_status have different purposes, making this distinct.

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 explicit 'When to use' (assessment, gap analysis) and 'When NOT to use' (not legal advice) sections, offering clear context. However, it does not explicitly contrast with sibling tools like classify_entity or list_article_21_measures, which could further guide selection.

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/CSOAI-ORG/nis2-compliance-mcp'

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