Skip to main content
Glama
joesecurity

JoeSandboxMCP

Official
by joesecurity

get_process_info

Extract and visualize the complete process execution tree from Joe Sandbox malware analysis reports to understand how malicious processes spawn and interact during runtime.

Instructions

Extract and return the full process tree for a specific analysis run from a Joe Sandbox report.

This tool traverses the execution tree recorded during dynamic analysis and returns a structured
process hierarchy, showing which processes spawned others, with their respective attributes.

Each process node includes:
  - name: Process executable name
  - pid: Process ID
  - cmdline: Full command-line invocation
  - path: File path of the executable
  - has_exited: Boolean flag indicating if the process terminated
  - children: List of child processes (if any), recursively structured
  - targetid: purely internal field, ignore this when replying to the user

The result can be large and deeply nested, depending on the behavior of the sample. To improve
readability, consider representing the tree using indentation or a UNIX-style `tree` layout. If the cmd args are not too long, consider displaying them as well, e.g.:

    parent.exe (1000) - "C:\Program Files\Parent\parent.exe"
    ├── child1.exe (1001) - "C:\Program Files\Parent\child1.exe --option"
    │   └── grandchild1.exe (1002) - "grandchild1.exe /silent"
    └── child2.exe (1003) - "child2.exe --config config.yaml --verbose"
        ├── grandchild2.exe (1004) - "grandchild2.exe"
        └── grandchild3.exe (1005) - "grandchild3.exe --debug --log-level=info"

Args:
    webid (required): Submission ID of the analysis.
    run (default: 0): Index of the sandbox run to inspect (from the `runs` array in analysis info).

Returns:
    Dictionary representing the root-level processes and their child process trees.
    If parsing or report retrieval fails, returns an error dictionary with a reason.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
webidYes
runNo

Implementation Reference

  • The main handler function for the get_process_info tool. It fetches the Joe Sandbox XML report using get_or_fetch_report, extracts the process tree using extract_process_tree, handles errors, and returns the structured process hierarchy.
    @mcp.tool()
    async def get_process_info(webid: str, run: int=0) -> Dict[str, Any]:
        """
        Extract and return the full process tree for a specific analysis run from a Joe Sandbox report.
    
        This tool traverses the execution tree recorded during dynamic analysis and returns a structured
        process hierarchy, showing which processes spawned others, with their respective attributes.
    
        Each process node includes:
          - name: Process executable name
          - pid: Process ID
          - cmdline: Full command-line invocation
          - path: File path of the executable
          - has_exited: Boolean flag indicating if the process terminated
          - children: List of child processes (if any), recursively structured
          - targetid: purely internal field, ignore this when replying to the user
    
        The result can be large and deeply nested, depending on the behavior of the sample. To improve
        readability, consider representing the tree using indentation or a UNIX-style `tree` layout. If the cmd args are not too long, consider displaying them as well, e.g.:
    
            parent.exe (1000) - "C:\Program Files\Parent\parent.exe"
            ├── child1.exe (1001) - "C:\Program Files\Parent\child1.exe --option"
            │   └── grandchild1.exe (1002) - "grandchild1.exe /silent"
            └── child2.exe (1003) - "child2.exe --config config.yaml --verbose"
                ├── grandchild2.exe (1004) - "grandchild2.exe"
                └── grandchild3.exe (1005) - "grandchild3.exe --debug --log-level=info"
    
        Args:
            webid (required): Submission ID of the analysis.
            run (default: 0): Index of the sandbox run to inspect (from the `runs` array in analysis info).
    
        Returns:
            Dictionary representing the root-level processes and their child process trees.
            If parsing or report retrieval fails, returns an error dictionary with a reason.
        """
    
        try:
            root = await get_or_fetch_report(webid, run)
            if root is None:
                return {"error": f"Could not retrieve or parse report for submission ID '{webid}' run {run}"}
            try:
                proc_tree = extract_process_tree(root)
            except Exception as e:
                return {"error": f"Could not reconstruct process tree for submission ID {webid} run {run}"}
    
            return proc_tree
    
        except Exception as e:
            return {
                "error": f"Failed to extract process tree for submission ID '{webid}' run {run}. "
                         f"Reason: {str(e)}"
            }
  • Supporting function that recursively parses the XML report's process elements to construct the nested dictionary representing the process tree, which is the core output of the tool.
    def extract_process_tree(process_elements) -> Dict[str, Any]:
        """
        Reconstructs a process tree as a nested json array from the xml report
        """
        def process_node(proc_elem):
            # Extract key attributes
            attrs = proc_elem.attrib
            node = {
                "name": attrs.get("name"),
                "pid": attrs.get("pid"),
                "cmdline": attrs.get("cmdline"),
                "path": attrs.get("path"),
                "targetid": attrs.get("targetid"),
                "has_exited": attrs.get("hasexited") == "true"
            }
    
            # Recursively extract children
            children = proc_elem.findall("./process")
            if children:
                node["children"] = [process_node(child) for child in children]
    
            return node
        process_elements = process_elements.findall("./behavior/system/startupoverview/process")
        return [process_node(p) for p in process_elements]
  • Helper function that retrieves the Joe Sandbox analysis report as XML ElementTree, either from cache or by downloading from the API, used by the handler to access the process data.
    async def get_or_fetch_report(webid: str, run: int=0) -> Optional[ET.Element]:
        """
        Get a report from the cache or fetch it from the API.
        
        Args:
            webid: The webid of the report to retrieve.
            run: The analysis run index of the report to retrieve, default: 0
            
        Returns:
            The report as an XML Element, or None if it couldn't be retrieved.
        """
        cache_key = f"{webid}-{run}"
        cached = await report_cache.get(cache_key)
        if cached:
            xml_stream = io.BytesIO(cached)
            xml_tree = ET.parse(xml_stream)
            return xml_tree.getroot()
        
        # If not in cache, fetch from API
        def blocking_download():
            client = get_client()
            _, data = client.analysis_download(webid=webid, type='xml', run=run)
            return data
        
        try:
            data = await asyncio.to_thread(blocking_download)
            await report_cache.set(cache_key, data)
            xml_stream = io.BytesIO(data)
            xml_tree = ET.parse(xml_stream)
            xml_root = xml_tree.getroot()
            return xml_root
        except Exception as e:
            print(f"Error fetching report for webid {webid}, run {run}: {e}")
            return None
  • jbxmcp/server.py:19-19 (registration)
    Import of the tools module in the MCP server setup, which triggers registration of all @mcp.tool()-decorated functions including get_process_info via FastMCP.
    import jbxmcp.tools as tools
Behavior5/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 and does so comprehensively. It describes the tool's behavior (traversing execution trees, returning structured hierarchies), discloses that results can be large and deeply nested, provides formatting suggestions for readability, and explains error handling (returns error dictionary on failure).

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 well-structured with clear sections (purpose, node details, formatting suggestions, args, returns) and appropriately sized. While comprehensive, some formatting examples could be slightly condensed, but every sentence adds value and the information is front-loaded with the core purpose first.

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

Completeness5/5

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

Given the tool's complexity (process tree extraction with hierarchical data), no annotations, and no output schema, the description provides complete context. It explains what the tool does, detailed node structure, parameter meanings, return format, error handling, and even provides formatting recommendations for the complex nested output.

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?

Despite 0% schema description coverage, the description fully compensates by providing detailed parameter semantics. It explains that 'webid' is the submission ID of the analysis and 'run' is the index of the sandbox run to inspect, including that run defaults to 0 and comes from the 'runs' array in analysis info. This adds substantial meaning beyond the bare schema.

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 tool extracts and returns the full process tree from a Joe Sandbox report, specifying it traverses the execution tree and returns a structured process hierarchy. It distinguishes from siblings by focusing specifically on process tree extraction rather than summaries, analysis info, or other report components.

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 provides clear context about when to use this tool (for extracting process trees from analysis runs) and mentions the result can be large and deeply nested. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools for different data needs.

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/joesecurity/joesandboxMCP'

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