Skip to main content
Glama
threat-zone

Threat.Zone MCP Server

by threat-zone

scan_file_sandbox

Submit files for sandbox analysis to detect malware by executing them in isolated environments with configurable settings like OS, timeout, and security modules.

Instructions

Submit a file for advanced sandbox analysis with detailed configuration.

Args: file_path: Path to the file to analyze is_public: Whether the scan results should be public (default: False) entrypoint: File to execute within archive (if applicable) password: Password for archive files (if applicable) environment: Analysis environment - w7_x64, w10_x64, w11_x64, macos, android, linux (default: w10_x64) timeout: Analysis timeout in seconds - 60, 120, 180, 240, 300 (default: 180) work_path: Working directory - desktop, root, %AppData%, windows, temp (default: desktop) mouse_simulation: Enable mouse simulation (default: True) https_inspection: Enable HTTPS inspection (default: False) internet_connection: Enable internet connection (default: False) raw_logs: Include raw logs (default: False) snapshot: Take VM snapshots (default: False) sleep_evasion: Enable sleep evasion techniques (default: False) smart_tracing: Enable smart tracing (default: False) dump_collector: Enable dump collection (default: False) open_in_browser: Open files in browser (default: False) extension_check: Perform extension check (default: True) modules: Analysis modules to use, e.g., ["csi", "cdr"] (default: None) auto_config: Use automatic configuration (default: False)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
is_publicNo
entrypointNo
passwordNo
environmentNow10_x64
timeoutNo
work_pathNodesktop
mouse_simulationNo
https_inspectionNo
internet_connectionNo
raw_logsNo
snapshotNo
sleep_evasionNo
smart_tracingNo
dump_collectorNo
open_in_browserNo
extension_checkNo
modulesNo
auto_configNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler for the 'scan_file_sandbox' tool. Decorated with @app.tool for MCP registration. Handles file validation, configuration assembly for ThreatZone sandbox analysis, and performs the API POST request with file upload.
    @app.tool
    async def scan_file_sandbox(
        file_path: str, 
        is_public: bool = False, 
        entrypoint: Optional[str] = None, 
        password: Optional[str] = None,
        environment: str = "w10_x64",
        timeout: int = 180,
        work_path: str = "desktop",
        mouse_simulation: bool = True,
        https_inspection: bool = False,
        internet_connection: bool = False,
        raw_logs: bool = False,
        snapshot: bool = False,
        sleep_evasion: bool = False,
        smart_tracing: bool = False,
        dump_collector: bool = False,
        open_in_browser: bool = False,
        extension_check: bool = True,
        modules: Optional[List[str]] = None,
        auto_config: bool = False
    ) -> Dict[str, Any]:
        """
        Submit a file for advanced sandbox analysis with detailed configuration.
        
        Args:
            file_path: Path to the file to analyze
            is_public: Whether the scan results should be public (default: False)
            entrypoint: File to execute within archive (if applicable)
            password: Password for archive files (if applicable)
            environment: Analysis environment - w7_x64, w10_x64, w11_x64, macos, android, linux (default: w10_x64)
            timeout: Analysis timeout in seconds - 60, 120, 180, 240, 300 (default: 180)
            work_path: Working directory - desktop, root, %AppData%, windows, temp (default: desktop)
            mouse_simulation: Enable mouse simulation (default: True)
            https_inspection: Enable HTTPS inspection (default: False)
            internet_connection: Enable internet connection (default: False)
            raw_logs: Include raw logs (default: False)
            snapshot: Take VM snapshots (default: False)
            sleep_evasion: Enable sleep evasion techniques (default: False)
            smart_tracing: Enable smart tracing (default: False)
            dump_collector: Enable dump collection (default: False)
            open_in_browser: Open files in browser (default: False)
            extension_check: Perform extension check (default: True)
            modules: Analysis modules to use, e.g., ["csi", "cdr"] (default: None)
            auto_config: Use automatic configuration (default: False)
        """
        if not Path(file_path).exists():
            raise ThreatZoneError(f"File not found: {file_path}")
        
        # Build the analyze configuration
        analyze_config = [
            {"metafieldId": "environment", "value": environment},
            {"metafieldId": "private", "value": not is_public},
            {"metafieldId": "timeout", "value": timeout},
            {"metafieldId": "work_path", "value": work_path},
            {"metafieldId": "mouse_simulation", "value": mouse_simulation},
            {"metafieldId": "https_inspection", "value": https_inspection},
            {"metafieldId": "internet_connection", "value": internet_connection},
            {"metafieldId": "raw_logs", "value": raw_logs},
            {"metafieldId": "snapshot", "value": snapshot},
            {"metafieldId": "sleep_evasion", "value": sleep_evasion},
            {"metafieldId": "smart_tracing", "value": smart_tracing},
            {"metafieldId": "dump_collector", "value": dump_collector},
            {"metafieldId": "open_in_browser", "value": open_in_browser}
        ]
        
        # Prepare form data
        data = {
            "analyzeConfig": json.dumps(analyze_config),
            "extensionCheck": str(extension_check).lower()
        }
        
        if entrypoint:
            data["entrypoint"] = entrypoint
        if password:
            data["password"] = password
        if modules:
            data["modules"] = ",".join(modules)
        
        # Build URL with auto parameter
        url = f"/public-api/scan/sandbox?auto={str(auto_config).lower()}"
        
        files = {"file": open(file_path, "rb")}
        try:
            return await get_client().post(url, data=data, files=files)
        finally:
            files["file"].close()
  • FastMCP decorator that registers the scan_file_sandbox function as an MCP tool with the name matching the function name.
    @app.tool
  • A helper tool 'scan_file_sandbox_simple' that provides a simplified interface by calling the main scan_file_sandbox with default parameters and auto_config=True.
    @app.tool
    async def scan_file_sandbox_simple(
        file_path: str, 
        is_public: bool = False, 
        entrypoint: Optional[str] = None, 
        password: Optional[str] = None
    ) -> Dict[str, Any]:
        """
        Submit a file for simple sandbox analysis using default settings.
        
        This is a simplified version of scan_file_sandbox with default configurations.
        Use scan_file_sandbox for advanced configuration options.
        
        Args:
            file_path: Path to the file to analyze
            is_public: Whether the scan results should be public (default: False)
            entrypoint: File to execute within archive (if applicable)
            password: Password for archive files (if applicable)
        """
        return await scan_file_sandbox(
            file_path=file_path,
            is_public=is_public,
            entrypoint=entrypoint,
            password=password,
            auto_config=True  # Use automatic configuration for simplicity
        )
  • Utility function to lazily initialize and return the ThreatZone API client used by scan_file_sandbox.
    def get_client():
        """Get or create the API client."""
        global client
        if client is None:
            if not API_KEY:
                raise ThreatZoneError("THREATZONE_API_KEY environment variable is required")
            client = APIClient(API_KEY)
        return client
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks critical behavioral details. It doesn't disclose whether this is a read-only or destructive operation, authentication requirements, rate limits, or what happens after submission (e.g., asynchronous processing). The description mentions 'analysis' but doesn't explain the tool's behavior beyond parameter configuration.

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 for a complex tool with 19 parameters. It's front-loaded with the core purpose, followed by detailed parameter explanations. While comprehensive, every sentence earns its place by clarifying parameter semantics that aren't in the schema.

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 high complexity (19 parameters), no annotations, and an output schema (which reduces need to describe returns), the description is partially complete. It excels at parameter semantics but lacks behavioral context like submission workflow, result retrieval, or error handling. The presence of an output schema helps but doesn't fully compensate for missing operational details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage and 19 parameters, the description provides extensive parameter semantics beyond the schema. It explains each parameter's purpose, acceptable values (e.g., environment options, timeout ranges), defaults, and conditional usage ('if applicable'), fully compensating for the schema's lack of descriptions.

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 the specific action ('Submit a file for advanced sandbox analysis') and resource ('file'), distinguishing it from simpler siblings like 'scan_file_sandbox_simple' and static/URL scanning tools. It specifies 'advanced' analysis with 'detailed configuration', providing clear differentiation.

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?

The description implies usage context through 'advanced sandbox analysis with detailed configuration', suggesting this is for comprehensive analysis rather than quick scans. However, it doesn't explicitly state when to use this vs. alternatives like 'scan_file_sandbox_simple' or 'scan_file_static', nor does it mention prerequisites or exclusions.

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

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