Skip to main content
Glama
czangyeob

MCP PII Tools

by czangyeob

mcp_encrypt_pii_item

Encrypts personally identifiable information (PII) like names, phone numbers, and emails using advanced cryptographic methods to protect sensitive data.

Instructions

MCP Tool: PII 항목 암호화

Args:
    pii_value (str): 암호화할 PII 값
    pii_type (str): PII 유형 (이름, 전화번호, 이메일 등)
    
Returns:
    Dict[str, Any]: 암호화 결과

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pii_valueYes
pii_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler function decorated with @mcp.tool(). It instantiates PIICrypto and calls its encrypt_pii_item method to perform the encryption, returning a structured result dictionary.
    def mcp_encrypt_pii_item(pii_value: str, pii_type: str) -> Dict[str, Any]:
        """
        MCP Tool: PII 항목 암호화
        
        Args:
            pii_value (str): 암호화할 PII 값
            pii_type (str): PII 유형 (이름, 전화번호, 이메일 등)
            
        Returns:
            Dict[str, Any]: 암호화 결과
        """
        try:
            crypto = PIICrypto()
            encrypted_value = crypto.encrypt_pii_item(pii_value, pii_type)
            
            return {
                "success": True,
                "original_value": pii_value,
                "encrypted_value": encrypted_value,
                "pii_type": pii_type,
                "encryption_method": "deterministic" if pii_type in crypto.deterministic_types else "fpe"
            }
        except Exception as e:
            return {
                "success": False,
                "error": str(e),
                "original_value": pii_value,
                "encrypted_value": "",
                "pii_type": pii_type
            }
  • JSON schema definition for the encrypt_pii_item tool in the MCP_TOOLS dictionary, specifying input parameters and their types/descriptions.
    "encrypt_pii_item": {
        "name": "encrypt_pii_item",
        "description": "개별 PII 항목을 암호화합니다. 이름, 주소, 이메일은 결정론적 암호화, 전화번호, 신용카드번호 등은 FPE(형식 유지 암호화)를 사용합니다.",
        "parameters": {
            "type": "object",
            "properties": {
                "pii_value": {
                    "type": "string",
                    "description": "암호화할 PII 값"
                },
                "pii_type": {
                    "type": "string",
                    "description": "PII 유형 (이름, 전화번호, 이메일, 주소, 신용카드번호, 여권번호, 주민등록번호 등)"
                }
            },
            "required": ["pii_value", "pii_type"]
        }
  • Core encryption logic in PIICrypto class. Routes to deterministic_encrypt for types like '이름', '주소', '이메일'; to fpe_encrypt for '전화번호', etc.; handles the actual encryption based on PII type.
    def encrypt_pii_item(self, pii_value: str, pii_type: str) -> str:
        """
        PII 항목을 유형에 따라 적절한 방식으로 암호화
        
        Args:
            pii_value: PII 값
            pii_type: PII 유형
            
        Returns:
            암호화된 값
        """
        if not pii_value:
            return pii_value
        
        if pii_type in self.deterministic_types:
            return self.deterministic_encrypt(pii_value, pii_type)
        elif pii_type in self.fpe_types:
            return self.fpe_encrypt(pii_value, pii_type)
        else:
            # 기본적으로 결정론적 암호화 사용
            return self.deterministic_encrypt(pii_value, pii_type)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool encrypts PII items but lacks details on encryption method, security implications, permissions required, rate limits, or error handling. For a tool handling sensitive data with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the tool's purpose. It uses a structured format with Args and Returns sections, which is efficient. However, the inclusion of 'MCP Tool:' is redundant, and the content could be more streamlined without losing clarity.

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?

Given the tool's complexity (handling sensitive PII data), lack of annotations, and presence of an output schema, the description is moderately complete. It covers basic purpose and parameters but misses critical behavioral details like security and error handling. The output schema likely documents return values, reducing the need for description here, but overall completeness is adequate with clear gaps.

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 description coverage is 0%, so the description must compensate. It adds basic semantics by explaining pii_value as '암호화할 PII 값' (PII value to encrypt) and pii_type as 'PII 유형 (이름, 전화번호, 이메일 등)' (PII type like name, phone number, email). However, it does not specify format constraints, examples, or validation rules, leaving parameters partially documented.

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's purpose as 'PII 항목 암호화' (PII item encryption), which specifies both the verb (encrypt) and resource (PII item). It distinguishes from siblings like mcp_encrypt_text_pii (which encrypts text PII) by focusing on individual PII items, though the distinction could be more explicit. The purpose is specific and actionable.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It does not mention siblings like mcp_encrypt_text_pii (for text PII) or mcp_anonymize_text (for anonymization), nor does it specify prerequisites or exclusions. Usage is implied by the tool name and description alone, leaving the agent to infer 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/czangyeob/mcp-pii-tools'

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