Skip to main content
Glama

check_cardholder_data

Analyze cardholder data flow for PCI DSS compliance. Input details about PAN storage, encryption, and tokenization to identify compliance gaps.

Instructions

Analyze cardholder data flow for PCI DSS compliance.

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: data_flow_description (str): The data flow description to analyze or process. stores_pan (bool): The stores pan to analyze or process. stores_cvv (bool): The stores cvv to analyze or process. stores_pin (bool): The stores pin to analyze or process. stores_track_data (bool): The stores track data to analyze or process. pan_encrypted (bool): The pan encrypted to analyze or process. pan_truncated (bool): The pan truncated to analyze or process. tokenization_used (bool): The tokenization used 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
data_flow_descriptionYes
stores_panNo
stores_cvvNo
stores_pinNo
stores_track_dataNo
pan_encryptedNo
pan_truncatedNo
tokenization_usedNo
callerNo
api_keyNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The check_cardholder_data function is an MCP tool decorated with @mcp.tool() that analyzes cardholder data flow for PCI DSS compliance. It checks for violations (CVV/PIN/track data storage, unprotected PAN, unmasked PAN), assesses scope reduction measures (tokenization, encryption, truncation), and returns a JSON compliance report.
    @mcp.tool()
    def check_cardholder_data(
        data_flow_description: str,
        stores_pan: bool = False,
        stores_cvv: bool = False,
        stores_pin: bool = False,
        stores_track_data: bool = False,
        pan_encrypted: bool = False,
        pan_truncated: bool = False,
        tokenization_used: bool = False,
        caller: str = "",
        api_key: str = "",
    ) -> str:
        """Analyze cardholder data flow for PCI DSS compliance.
    
        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:
            data_flow_description (str): The data flow description to analyze or process.
            stores_pan (bool): The stores pan to analyze or process.
            stores_cvv (bool): The stores cvv to analyze or process.
            stores_pin (bool): The stores pin to analyze or process.
            stores_track_data (bool): The stores track data to analyze or process.
            pan_encrypted (bool): The pan encrypted to analyze or process.
            pan_truncated (bool): The pan truncated to analyze or process.
            tokenization_used (bool): The tokenization used 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.
        """
        if err := _check_auth(api_key):
            return err
        if err := _rl(caller):
            return err
    
        issues = []
        if stores_cvv:
            issues.append({"violation": "CVV/CVC storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store CVV/CVC after authorization"})
        if stores_pin:
            issues.append({"violation": "PIN storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store PIN data after authorization"})
        if stores_track_data:
            issues.append({"violation": "Full track data storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store full track data after authorization"})
        if stores_pan and not pan_encrypted and not tokenization_used:
            issues.append({"violation": "PAN stored without protection", "requirement": "3.5.1",
                            "severity": "HIGH", "remediation": "Encrypt PAN at rest or use tokenization"})
        if stores_pan and not pan_truncated and not pan_encrypted:
            issues.append({"warning": "PAN displayed without masking", "requirement": "3.4.1",
                            "severity": "MEDIUM", "remediation": "Mask PAN when displayed (show max first 6 / last 4)"})
    
        scope_reduction = []
        if tokenization_used:
            scope_reduction.append("Tokenization reduces PCI scope for stored data")
        if pan_encrypted:
            scope_reduction.append("Encryption at rest meets Requirement 3.5")
        if pan_truncated:
            scope_reduction.append("Truncation removes PAN from scope when properly implemented")
    
        return json.dumps({
            "data_flow": data_flow_description,
            "assessment_date": datetime.now().isoformat(),
            "sensitive_auth_data": {"cvv": stores_cvv, "pin": stores_pin, "track_data": stores_track_data},
            "pan_storage": {"stored": stores_pan, "encrypted": pan_encrypted, "truncated": pan_truncated, "tokenized": tokenization_used},
            "compliance_status": "COMPLIANT" if not issues else "NON_COMPLIANT",
            "issues": issues,
            "scope_reduction_notes": scope_reduction,
        }, indent=2)
  • server.py:218-313 (registration)
    The tool is registered via the @mcp.tool() decorator on line 218, which registers it with the FastMCP server instance created on line 99. No separate registration call is needed; the decorator handles it automatically.
    @mcp.tool()
    def check_cardholder_data(
        data_flow_description: str,
        stores_pan: bool = False,
        stores_cvv: bool = False,
        stores_pin: bool = False,
        stores_track_data: bool = False,
        pan_encrypted: bool = False,
        pan_truncated: bool = False,
        tokenization_used: bool = False,
        caller: str = "",
        api_key: str = "",
    ) -> str:
        """Analyze cardholder data flow for PCI DSS compliance.
    
        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:
            data_flow_description (str): The data flow description to analyze or process.
            stores_pan (bool): The stores pan to analyze or process.
            stores_cvv (bool): The stores cvv to analyze or process.
            stores_pin (bool): The stores pin to analyze or process.
            stores_track_data (bool): The stores track data to analyze or process.
            pan_encrypted (bool): The pan encrypted to analyze or process.
            pan_truncated (bool): The pan truncated to analyze or process.
            tokenization_used (bool): The tokenization used 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.
        """
        if err := _check_auth(api_key):
            return err
        if err := _rl(caller):
            return err
    
        issues = []
        if stores_cvv:
            issues.append({"violation": "CVV/CVC storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store CVV/CVC after authorization"})
        if stores_pin:
            issues.append({"violation": "PIN storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store PIN data after authorization"})
        if stores_track_data:
            issues.append({"violation": "Full track data storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store full track data after authorization"})
        if stores_pan and not pan_encrypted and not tokenization_used:
            issues.append({"violation": "PAN stored without protection", "requirement": "3.5.1",
                            "severity": "HIGH", "remediation": "Encrypt PAN at rest or use tokenization"})
        if stores_pan and not pan_truncated and not pan_encrypted:
            issues.append({"warning": "PAN displayed without masking", "requirement": "3.4.1",
                            "severity": "MEDIUM", "remediation": "Mask PAN when displayed (show max first 6 / last 4)"})
    
        scope_reduction = []
        if tokenization_used:
            scope_reduction.append("Tokenization reduces PCI scope for stored data")
        if pan_encrypted:
            scope_reduction.append("Encryption at rest meets Requirement 3.5")
        if pan_truncated:
            scope_reduction.append("Truncation removes PAN from scope when properly implemented")
    
        return json.dumps({
            "data_flow": data_flow_description,
            "assessment_date": datetime.now().isoformat(),
            "sensitive_auth_data": {"cvv": stores_cvv, "pin": stores_pin, "track_data": stores_track_data},
            "pan_storage": {"stored": stores_pan, "encrypted": pan_encrypted, "truncated": pan_truncated, "tokenized": tokenization_used},
            "compliance_status": "COMPLIANT" if not issues else "NON_COMPLIANT",
            "issues": issues,
            "scope_reduction_notes": scope_reduction,
        }, indent=2)
  • Input schema is defined by the function signature (lines 219-230): data_flow_description (str), stores_pan/cvv/pin/track_data (bool), pan_encrypted/truncated (bool), tokenization_used (bool), caller (str), api_key (str). Output is a JSON string with fields data_flow, assessment_date, sensitive_auth_data, pan_storage, compliance_status, issues, scope_reduction_notes.
    @mcp.tool()
    def check_cardholder_data(
        data_flow_description: str,
        stores_pan: bool = False,
        stores_cvv: bool = False,
        stores_pin: bool = False,
        stores_track_data: bool = False,
        pan_encrypted: bool = False,
        pan_truncated: bool = False,
        tokenization_used: bool = False,
        caller: str = "",
        api_key: str = "",
    ) -> str:
        """Analyze cardholder data flow for PCI DSS compliance.
    
        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:
            data_flow_description (str): The data flow description to analyze or process.
            stores_pan (bool): The stores pan to analyze or process.
            stores_cvv (bool): The stores cvv to analyze or process.
            stores_pin (bool): The stores pin to analyze or process.
            stores_track_data (bool): The stores track data to analyze or process.
            pan_encrypted (bool): The pan encrypted to analyze or process.
            pan_truncated (bool): The pan truncated to analyze or process.
            tokenization_used (bool): The tokenization used 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.
        """
        if err := _check_auth(api_key):
            return err
        if err := _rl(caller):
            return err
    
        issues = []
        if stores_cvv:
            issues.append({"violation": "CVV/CVC storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store CVV/CVC after authorization"})
        if stores_pin:
            issues.append({"violation": "PIN storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store PIN data after authorization"})
        if stores_track_data:
            issues.append({"violation": "Full track data storage prohibited", "requirement": "3.3.1",
                            "severity": "CRITICAL", "remediation": "Never store full track data after authorization"})
        if stores_pan and not pan_encrypted and not tokenization_used:
            issues.append({"violation": "PAN stored without protection", "requirement": "3.5.1",
                            "severity": "HIGH", "remediation": "Encrypt PAN at rest or use tokenization"})
        if stores_pan and not pan_truncated and not pan_encrypted:
            issues.append({"warning": "PAN displayed without masking", "requirement": "3.4.1",
                            "severity": "MEDIUM", "remediation": "Mask PAN when displayed (show max first 6 / last 4)"})
    
        scope_reduction = []
        if tokenization_used:
            scope_reduction.append("Tokenization reduces PCI scope for stored data")
        if pan_encrypted:
            scope_reduction.append("Encryption at rest meets Requirement 3.5")
        if pan_truncated:
            scope_reduction.append("Truncation removes PAN from scope when properly implemented")
    
        return json.dumps({
            "data_flow": data_flow_description,
            "assessment_date": datetime.now().isoformat(),
            "sensitive_auth_data": {"cvv": stores_cvv, "pin": stores_pin, "track_data": stores_track_data},
            "pan_storage": {"stored": stores_pan, "encrypted": pan_encrypted, "truncated": pan_truncated, "tokenized": tokenization_used},
            "compliance_status": "COMPLIANT" if not issues else "NON_COMPLIANT",
            "issues": issues,
            "scope_reduction_notes": scope_reduction,
        }, indent=2)
  • Helper functions used inside the handler: _check_auth (lines 30-33) validates the API key, and _rl (lines 41-53) enforces free tier rate limiting. Both are called at the top of the handler.
    if err := _check_auth(api_key):
        return err
    if err := _rl(caller):
        return err
Behavior5/5

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

With no annotations, the description fully discloses side effects (none), authentication (optional), rate limits (10/day free), error handling, idempotency, and data privacy. This is thorough and honest.

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?

Well-structured with sections, but redundant: 'Behavior' and 'Behavioral Transparency' overlap. The Args section could be trimmed since schema shows titles. Lengthy for the content conveyed.

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 usage, behavior, and limitations thoroughly. With an output schema present, missing output explanation is acceptable. Lacks examples or clarification for boolean parameters, but overall complete for the tool's complexity.

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 description coverage is 0%, so description must compensate. However, the Args section merely repeats parameter names with generic phrases like 'The {name} to analyze or process,' adding no meaningful context beyond the schema's titles.

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 it analyzes cardholder data flow for PCI DSS compliance, with a specific verb and resource. It distinguishes from sibling tools by focusing on data flow analysis versus broader compliance assessment or documentation generation.

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?

Provides explicit 'When to use' and 'When NOT to use' sections, covering audit, gap analysis, and documentation. However, it does not directly compare with sibling tools or specify when to choose alternatives.

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/pci-dss-mcp'

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