Skip to main content
Glama
czangyeob

MCP PII Tools

by czangyeob

mcp_decrypt_pii_item

Decrypt encrypted personally identifiable information (PII) data items using advanced cryptographic methods. Specify the encrypted value and PII type to retrieve the original data.

Instructions

MCP Tool: PII 항목 복호화

Args:
    encrypted_value (str): 복호화할 암호화된 값
    pii_type (str): PII 유형
    
Returns:
    Dict[str, Any]: 복호화 결과

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
encrypted_valueYes
pii_typeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler function for mcp_decrypt_pii_item. Instantiates PIICrypto and calls its decrypt_pii_item method, returning a standardized response dictionary.
    @mcp.tool()
    def mcp_decrypt_pii_item(encrypted_value: str, pii_type: str) -> Dict[str, Any]:
        """
        MCP Tool: PII 항목 복호화
        
        Args:
            encrypted_value (str): 복호화할 암호화된 값
            pii_type (str): PII 유형
            
        Returns:
            Dict[str, Any]: 복호화 결과
        """
        try:
            crypto = PIICrypto()
            decrypted_value = crypto.decrypt_pii_item(encrypted_value, pii_type)
            
            return {
                "success": True,
                "encrypted_value": encrypted_value,
                "decrypted_value": decrypted_value,
                "pii_type": pii_type,
                "decryption_method": "deterministic" if pii_type in crypto.deterministic_types else "fpe"
            }
        except Exception as e:
            return {
                "success": False,
                "error": str(e),
                "encrypted_value": encrypted_value,
                "decrypted_value": "",
                "pii_type": pii_type
            }
  • JSON schema and metadata definition for the decrypt_pii_item tool in MCP_TOOLS dictionary, specifying parameters, types, descriptions, and required fields.
    "decrypt_pii_item": {
        "name": "decrypt_pii_item",
        "description": "암호화된 PII 항목을 복호화합니다.",
        "parameters": {
            "type": "object",
            "properties": {
                "encrypted_value": {
                    "type": "string",
                    "description": "복호화할 암호화된 값"
                },
                "pii_type": {
                    "type": "string",
                    "description": "PII 유형 (암호화 시 사용한 유형과 동일해야 함)"
                }
            },
            "required": ["encrypted_value", "pii_type"]
        }
    },
  • Core helper method in PIICrypto class that performs the actual decryption: chooses deterministic_decrypt or fpe_decrypt based on pii_type.
    def decrypt_pii_item(self, encrypted_value: str, pii_type: str) -> str:
        """
        암호화된 PII 항목을 복호화
        
        Args:
            encrypted_value: 암호화된 값
            pii_type: PII 유형
            
        Returns:
            복호화된 값
        """
        if not encrypted_value:
            return encrypted_value
        
        if pii_type in self.deterministic_types:
            return self.deterministic_decrypt(encrypted_value, pii_type)
        elif pii_type in self.fpe_types:
            return self.fpe_decrypt(encrypted_value, pii_type)
        else:
            # 기본적으로 결정론적 복호화 사용
            return self.deterministic_decrypt(encrypted_value, pii_type)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool decrypts PII items but doesn't cover critical aspects: what permissions or authentication are required, whether it's a read-only or mutating operation, potential rate limits, error handling, or what the decryption process entails. This leaves significant gaps in understanding the tool's behavior and constraints.

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 brief and structured with clear sections for Args and Returns, making it easy to scan. However, the first line 'MCP Tool: PII 항목 복호화' is somewhat redundant with the tool name, and the content could be more front-loaded with critical usage information. Overall, it's efficient but not optimally organized for immediate understanding.

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 (decryption operation with security implications), lack of annotations, and an output schema that only indicates a dict return, the description is incomplete. It covers basic purpose and parameters but misses behavioral context, error cases, and security considerations. The output schema helps by specifying the return type, but the description should do more to compensate for the annotation gap.

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 schema provides no parameter details. The description adds basic semantics: 'encrypted_value' is the value to decrypt, and 'pii_type' is the PII type. However, it doesn't explain valid pii_type values, encryption formats, or examples, which limits practical use. This partial compensation justifies a baseline score, but more detail would be needed for higher marks.

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 decryption), which is a specific verb+resource combination. It distinguishes itself from siblings like mcp_decrypt_text_pii (text PII decryption) and mcp_encrypt_pii_item (PII item encryption), though the differentiation could be more explicit. The description doesn't fully explain what constitutes a 'PII item' versus 'text PII,' leaving some ambiguity.

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 doesn't mention prerequisites (e.g., needing encrypted PII data), exclusions, or comparisons to siblings like mcp_decrypt_text_pii or mcp_encrypt_pii_item. The agent must infer usage from the tool name and context alone, which is insufficient for clear decision-making.

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