Skip to main content
Glama
threat-zone

Threat.Zone MCP Server

by threat-zone

scan_file_cdr

Submit files for Content Disarm and Reconstruction to remove potentially malicious content while preserving functionality, enabling safe file analysis and sharing.

Instructions

Submit a file for CDR (Content Disarm and Reconstruction) processing.

Args: file_path: Path to the file to process is_public: Whether the scan results should be public entrypoint: File to execute within archive (if applicable) password: Password for archive files (if applicable)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
is_publicNo
entrypointNo
passwordNo

Implementation Reference

  • The main handler function for the 'scan_file_cdr' tool. It is decorated with @app.tool for registration in FastMCP and implements the logic to upload a file to the ThreatZone API's CDR endpoint for content disarm and reconstruction processing.
    @app.tool
    async def scan_file_cdr(
        file_path: str, 
        is_public: bool = False, 
        entrypoint: Optional[str] = None, 
        password: Optional[str] = None
    ) -> Dict[str, Any]:
        """
        Submit a file for CDR (Content Disarm and Reconstruction) processing.
        
        Args:
            file_path: Path to the file to process
            is_public: Whether the scan results should be public
            entrypoint: File to execute within archive (if applicable)
            password: Password for archive files (if applicable)
        """
        if not Path(file_path).exists():
            raise ThreatZoneError(f"File not found: {file_path}")
        
        data = {"isPublic": is_public}
        if entrypoint:
            data["entrypoint"] = entrypoint
        if password:
            data["password"] = password
        
        files = {"file": open(file_path, "rb")}
        try:
            return await get_client().post("/public-api/scan/cdr", data=data, files=files)
        finally:
            files["file"].close()

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/threat-zone/threatzonemcp'

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