Skip to main content
Glama
detection-forge

agentic-detection-lookups

Check Parent-Child Process

detection_check_parent_child
Read-onlyIdempotent

Check if a parent-child process relationship is expected or suspicious, delivering risk level, MITRE technique, and triage notes.

Instructions

Check if a process parent-child relationship is expected or suspicious.

Provide parent and child process filenames (e.g., parent='winword.exe', child='cmd.exe'). Returns whether the relationship is expected, the risk if unexpected, MITRE technique, and triage notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parentYes
childYes
os_filterNowindows

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Main handler function for detection_check_parent_child tool. Takes parent, child, and optional os_filter parameters. Strips paths, loads parent-child baseline data, matches against CSV rows with glob support, and returns found/matches with risk assessment.
    def detection_check_parent_child(
        parent: str,
        child: str,
        os_filter: str = "windows",
    ) -> dict[str, Any]:
        """Check if a process parent-child relationship is expected or suspicious.
    
        Provide parent and child process filenames (e.g., parent='winword.exe', child='cmd.exe').
        Returns whether the relationship is expected, the risk if unexpected, MITRE technique, and triage notes.
        """
        parent_lower = parent.lower().strip()
        child_lower = child.lower().strip()
    
        # Strip paths
        if "\\" in parent_lower or "/" in parent_lower:
            parent_lower = parent_lower.replace("\\", "/").split("/")[-1]
        if "\\" in child_lower or "/" in child_lower:
            child_lower = child_lower.replace("\\", "/").split("/")[-1]
    
        matches = []
        for row in _get_parent_child():
            if row.get("os", "").lower() != os_filter.lower():
                continue
    
            row_parent = row.get("parent", "").lower()
            row_child = row.get("child", "").lower()
    
            # Check parent match (exact or glob)
            parent_match = _match_filename(row_parent, parent_lower)
            # Check child match (exact, glob, or wildcard)
            child_match = row_child == "*" or _match_filename(row_child, child_lower)
    
            if parent_match and child_match:
                matches.append({
                    "parent": row.get("parent", ""),
                    "child": row.get("child", ""),
                    "os": row.get("os", ""),
                    "expected": row.get("expected", ""),
                    "risk_if_unexpected": row.get("risk_if_unexpected", ""),
                    "mitre_id": row.get("mitre_id", ""),
                    "context": row.get("context", ""),
                    "notes": row.get("notes", ""),
                })
    
        if not matches:
            return {
                "found": False,
                "parent": parent_lower,
                "child": child_lower,
                "os": os_filter,
                "assessment": (
                    "No baseline entry found. This may be suspicious — "
                    "undocumented parent-child relationships warrant investigation."
                ),
                "suggestion": (
                    "Try checking each process individually with "
                    "detection_lookup_binary to see if either is a known LOLBin."
                ),
            }
    
        # Return most specific match (prefer exact child over wildcard)
        best = sorted(matches, key=lambda m: (m["child"] == "*", m["expected"] == "true"))
        return {"found": True, "matches": best}
  • MCP tool registration decorator with annotations (title, readOnlyHint, destructiveHint, idempotentHint, openWorldHint) for detection_check_parent_child.
    @mcp.tool(
        annotations={
            "title": "Check Parent-Child Process",
            "readOnlyHint": True,
            "destructiveHint": False,
            "idempotentHint": True,
            "openWorldHint": False,
        },
    )
  • Function signature defines the input schema: parent (str), child (str), os_filter (str, default 'windows'). Docstring describes expected usage and return values.
    def detection_check_parent_child(
        parent: str,
        child: str,
        os_filter: str = "windows",
    ) -> dict[str, Any]:
        """Check if a process parent-child relationship is expected or suspicious.
    
        Provide parent and child process filenames (e.g., parent='winword.exe', child='cmd.exe').
        Returns whether the relationship is expected, the risk if unexpected, MITRE technique, and triage notes.
        """
  • Helper function _match_filename uses fnmatch glob matching for parent/child process name comparisons.
    def _match_filename(pattern: str, value: str) -> bool:
        """Match with glob support (e.g., 'tomcat*.exe')."""
        return fnmatch(value.lower(), pattern.lower())
  • Helper function _get_parent_child loads parent_child_baselines.csv with caching.
    def _get_parent_child() -> list[dict[str, str]]:
        global _parent_child_cache
        if _parent_child_cache is None:
            _parent_child_cache = _load_csv("parent_child_baselines.csv")
        return _parent_child_cache
Behavior4/5

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

Annotations already indicate read-only, non-destructive behavior. The description adds that it returns expected status, risk, MITRE technique, and triage notes, which clarifies the output format. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is four sentences, front-loading the purpose, then providing usage format and output details. Every sentence is informative and concise.

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 low complexity (two required string params, one optional, output schema exists), the description covers purpose, inputs, and output sufficiently. No gaps remain.

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%, but the description provides example filenames for parent and child and mentions os_filter with default 'windows'. However, it does not explain acceptable values for os_filter beyond the default, so compensation is partial.

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 it checks if a process parent-child relationship is expected or suspicious, with a specific verb and resource. It distinguishes from sibling tools like detection_list_by_category or detection_search by focusing on a specific analysis of parent-child pairs.

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 explains how to use the tool: provide parent and child filenames, optionally an OS filter. It does not explicitly say when not to use it or name alternatives, but the context from sibling tools shows it is specialized for parent-child checks.

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/detection-forge/agentic-detection-lookups'

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