Skip to main content
Glama
czangyeob

MCP PII Tools

by czangyeob

mcp_batch_process

Process multiple texts simultaneously to detect, anonymize, encrypt, or decrypt personally identifiable information using GPT-4o-based detection and cryptographic methods.

Instructions

MCP Tool: 여러 텍스트 일괄 처리

Args:
    texts (List[str]): 처리할 텍스트 리스트
    
Returns:
    Dict[str, Any]: 일괄 처리 결과

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'mcp_batch_process' MCP tool. It is decorated with @mcp.tool() for automatic registration and delegates to MCPPIIProcessor.batch_process for the core logic.
    @mcp.tool()
    def mcp_batch_process(texts: List[str]) -> Dict[str, Any]:
        """
        MCP Tool: 여러 텍스트 일괄 처리
        
        Args:
            texts (List[str]): 처리할 텍스트 리스트
            
        Returns:
            Dict[str, Any]: 일괄 처리 결과
        """
        processor = MCPPIIProcessor()
        return processor.batch_process(texts)
  • Core helper method in MCPPIIProcessor class that implements the batch PII processing logic by iterating over texts and calling process_text on each.
    def batch_process(self, texts: List[str]) -> Dict[str, Any]:
        """
        여러 텍스트를 일괄 처리 (MCP Tool용)
        
        Args:
            texts (List[str]): 처리할 텍스트 리스트
            
        Returns:
            Dict[str, Any]: MCP Tool 응답 형식
        """
        try:
            start_time = time.time()
            results = []
            
            for i, text in enumerate(texts):
                result = self.process_text(text)
                result["index"] = i
                results.append(result)
            
            processing_time = time.time() - start_time
            
            # 전체 통계
            total_pii = sum(result["count"] for result in results if result["success"])
            successful_count = sum(1 for result in results if result["success"])
            
            return {
                "success": True,
                "results": results,
                "total_texts": len(texts),
                "successful_count": successful_count,
                "total_pii_detected": total_pii,
                "processing_time": processing_time,
                "average_time_per_text": processing_time / len(texts) if texts else 0
            }
            
        except Exception as e:
            return {
                "success": False,
                "error": str(e),
                "results": [],
                "total_texts": len(texts),
                "successful_count": 0,
                "total_pii_detected": 0,
                "processing_time": 0,
                "average_time_per_text": 0
            }
  • JSON schema definition for the batch_process tool input parameters, specifying 'texts' as a required array of strings.
    "batch_process": {
        "name": "batch_process",
        "description": "여러 텍스트를 일괄적으로 PII(개인 정보) 처리합니다.",
        "parameters": {
            "type": "object",
            "properties": {
                "texts": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "처리할 텍스트 리스트"
                }
            },
            "required": ["texts"]
        }
  • The @mcp.tool() decorator registers the function as an MCP tool named 'mcp_batch_process'.
    @mcp.tool()
    def mcp_batch_process(texts: List[str]) -> Dict[str, Any]:
        """
        MCP Tool: 여러 텍스트 일괄 처리
        
        Args:
            texts (List[str]): 처리할 텍스트 리스트
            
        Returns:
            Dict[str, Any]: 일괄 처리 결과
        """
        processor = MCPPIIProcessor()
        return processor.batch_process(texts)
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. The description only states it 'processes' texts in batch and returns results, without explaining what processing entails, whether it's read-only or mutative, what permissions are needed, error handling, rate limits, or any behavioral traits. This is inadequate for a tool with no annotation coverage.

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 structured with Args and Returns sections, which is organized. However, it includes redundant elements like 'MCP Tool:' prefix and could be more front-loaded. The content is concise but under-specified - every sentence earns its place but provides insufficient information overall.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema description coverage, but having an output schema (Returns: Dict[str, Any]), the description is incomplete. It doesn't explain what the batch processing actually does, how it differs from siblings, what the return dictionary contains, or any behavioral aspects. For a tool with one parameter but unclear functionality among multiple siblings, this description leaves critical 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 mentions 'texts (List[str]): 처리할 텍스트 리스트' (texts to process list), which adds basic semantics about the parameter being a list of strings for processing. However, it doesn't explain constraints like minimum/maximum list size, text length limits, or content requirements. The description provides minimal parameter context beyond what the bare schema shows.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states '여러 텍스트 일괄 처리' (batch processing of multiple texts) which is a tautology of the tool name 'mcp_batch_process'. While it mentions the verb '처리' (process) and resource '텍스트' (texts), it doesn't specify what kind of processing occurs or how this differs from sibling tools like 'mcp_process_text'. The purpose remains vague beyond the literal translation of the name.

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

Usage Guidelines1/5

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

No guidance is provided on when to use this tool versus alternatives. With siblings like 'mcp_process_text' (which appears to process individual texts) and various PII-related tools (anonymize, detect, encrypt, decrypt), there's no indication whether this tool is for bulk operations, specific processing types, or how it relates to other tools. The description offers zero usage 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