Skip to main content
Glama
CSOAI-ORG

EU AI Act Compliance MCP

classify_ai_risk

Classify AI systems under the EU AI Act by assessing risk levels from prohibited to minimal. Ideal for compliance audits and gap analysis.

Instructions

Classify an AI system's risk level under the EU AI Act.

Takes a description of an AI system and returns its risk classification: prohibited, high-risk, limited-risk, or minimal-risk — per Article 5 (prohibited practices), Article 6 + Annex III (high-risk), Articles 50/52 (limited risk: transparency obligations), or minimal risk.

Includes all 8 Annex III high-risk areas and all Article 5 prohibited practices.

Args: description: A description of the AI system, its purpose, data used, and deployment context. caller: Identifier for rate limiting. tier: "free" (10 calls/day) or "pro" (unlimited, $29/mo).

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionYes
callerNoanonymous
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the classify_ai_risk MCP tool. It takes an AI system description and returns risk classification (prohibited, high-risk, limited-risk, minimal-risk) by checking against Article 5 prohibited practices, Annex III high-risk areas, limited risk transparency triggers, and defaulting to minimal risk.
    @mcp.tool()
    def classify_ai_risk(
        description: str,
        caller: str = "anonymous",
        api_key: str = "") -> str:
        """Classify an AI system's risk level under the EU AI Act.
    
        Takes a description of an AI system and returns its risk classification:
        prohibited, high-risk, limited-risk, or minimal-risk — per Article 5
        (prohibited practices), Article 6 + Annex III (high-risk), Articles 50/52
        (limited risk: transparency obligations), or minimal risk.
    
        Includes all 8 Annex III high-risk areas and all Article 5 prohibited practices.
    
        Args:
            description: A description of the AI system, its purpose, data used, and deployment context.
            caller: Identifier for rate limiting.
            tier: "free" (10 calls/day) or "pro" (unlimited, $29/mo).
    
        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.
        """
        allowed, msg, tier = check_access(api_key)
        if not allowed:
            return {"error": msg, "upgrade_url": "https://meok.ai/pricing"}
        limit_err = _check_rate_limit(caller, tier)
        if limit_err:
            return {"error": "rate_limited", "message": limit_err}
    
        result = {
            "classification": "minimal",
            "confidence": "low",
            "prohibited_matches": [],
            "high_risk_matches": [],
            "limited_risk_triggers": [],
            "analysis": "",
            "regulation": "Regulation (EU) 2024/1689",
            "meok_labs": "https://meok.ai",
        }
    
        # Check prohibited practices (Article 5)
        for practice in PROHIBITED_PRACTICES:
            matches = _match_keywords(description, practice["keywords"])
            if matches:
                result["prohibited_matches"].append({
                    "practice_id": practice["id"],
                    "article": practice["article"],
                    "description": practice["description"],
                    "matched_keywords": matches,
                })
    
        if result["prohibited_matches"]:
            result["classification"] = "prohibited"
            result["confidence"] = "high" if len(result["prohibited_matches"]) >= 2 else "medium"
            result["analysis"] = (
                f"WARNING: This AI system matches {len(result['prohibited_matches'])} prohibited practice(s) "
                f"under Article 5. Prohibited AI systems may not be placed on the market, put into service, "
                f"or used in the EU. Penalties: up to EUR 35 million or 7% of global annual turnover "
                f"(Article 99(3)). Enforcement date: 2 February 2025."
            )
            return result
    
        # Check high-risk (Annex III)
        for area in ANNEX_III_HIGH_RISK:
            matches = _match_keywords(description, area["keywords"])
            if matches:
                result["high_risk_matches"].append({
                    "area": area["area"],
                    "title": area["title"],
                    "article_ref": area["article_ref"],
                    "description": area["description"],
                    "subcategories": area["subcategories"],
                    "matched_keywords": matches,
                })
    
        if result["high_risk_matches"]:
            result["classification"] = "high-risk"
            result["confidence"] = "high" if len(result["high_risk_matches"]) >= 2 else "medium"
            areas_str = ", ".join(f"Area {m['area']} ({m['title']})" for m in result["high_risk_matches"])
            result["analysis"] = (
                f"This AI system is classified as HIGH-RISK under Annex III, matching: {areas_str}. "
                f"High-risk systems must comply with Articles 9-15 (risk management, data governance, "
                f"technical documentation, logging, transparency, human oversight, accuracy/robustness/cybersecurity). "
                f"A conformity assessment is required before placing on the market. "
                f"Full enforcement: 2 August 2026."
            )
            return result
    
        # Check limited risk (transparency obligations — Article 50)
        limited_keywords = [
            "chatbot", "chat bot", "conversational ai", "virtual assistant",
            "deepfake", "synthetic media", "generated image", "generated video",
            "generated text", "emotion recognition", "biometric categori",
            "generative ai", "foundation model", "large language model", "llm",
        ]
        limited_matches = _match_keywords(description, limited_keywords)
        if limited_matches:
            result["classification"] = "limited-risk"
            result["confidence"] = "medium"
            result["limited_risk_triggers"] = limited_matches
            result["analysis"] = (
                f"This AI system falls under LIMITED-RISK with transparency obligations (Article 50). "
                f"Matched triggers: {', '.join(limited_matches)}. "
                f"Requirements: (1) Persons interacting with AI must be informed they are interacting with AI, "
                f"(2) AI-generated/manipulated content must be marked as such, "
                f"(3) Deployers of emotion recognition/biometric categorisation must inform persons. "
                f"GPAI model providers have additional obligations under Articles 51-56."
            )
            return result
    
        # Minimal risk
        result["classification"] = "minimal"
        result["confidence"] = "low"
        result["analysis"] = (
            "Based on the provided description, this AI system appears to be MINIMAL RISK. "
            "No specific regulatory obligations under the EU AI Act, though voluntary codes of "
            "conduct are encouraged (Article 95). Providers may voluntarily apply high-risk "
            "requirements. Note: classification confidence is low — provide more detail about "
            "the system's purpose, data usage, and deployment context for a more accurate assessment."
        )
        return result
  • server.py:667-668 (registration)
    Registration of classify_ai_risk as an MCP tool via the @mcp.tool() decorator on FastMCP instance.
    @mcp.tool()
    def classify_ai_risk(
  • Input schema and parameter definitions for classify_ai_risk: description (str), caller (str), api_key (str). The docstring also describes the output schema which is a dict with classification, confidence, prohibited_matches, high_risk_matches, limited_risk_triggers, analysis, regulation, and meok_labs keys.
    def classify_ai_risk(
        description: str,
        caller: str = "anonymous",
        api_key: str = "") -> str:
        """Classify an AI system's risk level under the EU AI Act.
    
        Takes a description of an AI system and returns its risk classification:
        prohibited, high-risk, limited-risk, or minimal-risk — per Article 5
        (prohibited practices), Article 6 + Annex III (high-risk), Articles 50/52
        (limited risk: transparency obligations), or minimal risk.
    
        Includes all 8 Annex III high-risk areas and all Article 5 prohibited practices.
    
        Args:
            description: A description of the AI system, its purpose, data used, and deployment context.
            caller: Identifier for rate limiting.
            tier: "free" (10 calls/day) or "pro" (unlimited, $29/mo).
    
        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.
        """
  • Helper function _match_keywords used by classify_ai_risk to match description text against keyword lists (case-insensitive).
    def _match_keywords(text: str, keywords: list[str]) -> list[str]:
        """Return matched keywords found in text (case-insensitive)."""
        text_lower = text.lower()
        return [kw for kw in keywords if kw.lower() in text_lower]
  • Knowledge base data: PROHIBITED_PRACTICES (Article 5) and ANNEX_III_HIGH_RISK used by classify_ai_risk for keyword matching.
    PROHIBITED_PRACTICES = [
        {
            "id": "ART5-1a",
            "article": "Article 5(1)(a)",
            "description": "Subliminal, manipulative, or deceptive techniques that distort behaviour and cause significant harm",
            "keywords": ["subliminal", "manipulat", "deceiv", "distort behavio", "dark pattern", "coercive design"],
        },
        {
            "id": "ART5-1b",
            "article": "Article 5(1)(b)",
            "description": "Exploitation of vulnerabilities due to age, disability, or social/economic situation",
            "keywords": ["vulnerab", "elderly", "child", "disabilit", "exploit", "economic situation"],
        },
        {
            "id": "ART5-1c",
            "article": "Article 5(1)(c)",
            "description": "Social scoring by public authorities leading to detrimental treatment",
            "keywords": ["social scor", "citizen scor", "social credit", "public authority score"],
        },
        {
            "id": "ART5-1d",
            "article": "Article 5(1)(d)",
            "description": "Risk assessment of natural persons for criminal offences based solely on profiling or personality traits (except as supplement to human assessment)",
            "keywords": ["criminal predict", "recidivism", "crime profil", "predictive polic"],
        },
        {
            "id": "ART5-1e",
            "article": "Article 5(1)(e)",
            "description": "Untargeted scraping of facial images from internet or CCTV for facial recognition databases",
            "keywords": ["facial scrap", "untargeted scraping", "facial recognition database", "mass surveillance face"],
        },
        {
            "id": "ART5-1f",
            "article": "Article 5(1)(f)",
            "description": "Emotion recognition in workplaces and educational institutions (except for medical/safety reasons)",
            "keywords": ["emotion recognition work", "emotion recognition school", "emotion detection employ", "affect recognition edu"],
        },
        {
            "id": "ART5-1g",
            "article": "Article 5(1)(g)",
            "description": "Biometric categorisation inferring sensitive attributes (race, political opinions, trade union membership, religious beliefs, sex life, sexual orientation)",
            "keywords": ["biometric categori", "race classif", "religion classif", "political opinion classif", "infer sensitive"],
        },
        {
            "id": "ART5-1h",
            "article": "Article 5(1)(h)",
            "description": "Real-time remote biometric identification in publicly accessible spaces for law enforcement (with narrow exceptions)",
            "keywords": ["real-time biometric", "live facial recognition", "remote biometric identif", "real-time surveillance"],
        },
    ]
Behavior5/5

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

Despite no annotations, the description fully discloses behavior: read-only, stateless, idempotent, rate limits for free/pro tiers, and no authentication required. This covers key behavioral traits.

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 well-structured with sections: purpose, args, behavior, when to use/not use. It is informative without verbosity, front-loading key information and using bullet-like formatting for clarity.

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?

Covers input parameters, behavior, and usage guidance. The mention of output schema means return details are handled elsewhere. However, the parameter inconsistency (tier vs api_key) and lack of explanation for api_key slightly detract from completeness.

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?

The description adds meaning for 'description' and 'caller' parameters, but it introduces a non-existent 'tier' parameter while ignoring 'api_key' in the schema. This mismatch reduces clarity and completeness despite some added value.

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 classifies AI systems under the EU AI Act, listing four specific risk levels and references to relevant articles. It distinguishes this tool from siblings like 'assess_penalties' or 'check_compliance' by specifying the exact regulatory framework.

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

Usage Guidelines5/5

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

Explicit 'When to use' and 'When NOT to use' sections provide clear guidance. Usage contexts like gap analysis and compliance documentation are given, along with a strong caveat against substituting for legal counsel.

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/eu-ai-act-compliance-mcp'

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