Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

create_hunt

Create a Velociraptor hunt to collect forensic artifacts across multiple endpoints with configurable filters for targeted investigation.

Instructions

Create a new Velociraptor hunt to collect artifacts across multiple clients.

Args: artifacts: List of artifact names to collect description: Description of the hunt's purpose parameters: Optional parameters for artifacts. Format: {"ArtifactName": {"param": "value"}} include_labels: Only include clients with these labels exclude_labels: Exclude clients with these labels os_filter: Filter by OS: 'windows', 'linux', 'darwin' timeout: Query timeout per client in seconds (default 600) expires_hours: Hunt expiration in hours (default 24) paused: Create hunt in paused state (default True for safety)

Returns: Hunt ID and details.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
artifactsYes
descriptionYes
parametersNo
include_labelsNo
exclude_labelsNo
os_filterNo
timeoutNo
expires_hoursNo
pausedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The 'create_hunt' function is defined as an MCP tool in this file, which handles the creation of a Velociraptor hunt via VQL query execution through the MCP client.
    @mcp.tool()
    async def create_hunt(
        artifacts: list[str],
        description: str,
        parameters: Optional[dict[str, Any]] = None,
        include_labels: Optional[list[str]] = None,
        exclude_labels: Optional[list[str]] = None,
        os_filter: Optional[str] = None,
        timeout: int = 600,
        expires_hours: int = 24,
        paused: bool = True,
    ) -> list[TextContent]:
        """Create a new Velociraptor hunt to collect artifacts across multiple clients.
    
        Args:
            artifacts: List of artifact names to collect
            description: Description of the hunt's purpose
            parameters: Optional parameters for artifacts. Format: {"ArtifactName": {"param": "value"}}
            include_labels: Only include clients with these labels
            exclude_labels: Exclude clients with these labels
            os_filter: Filter by OS: 'windows', 'linux', 'darwin'
            timeout: Query timeout per client in seconds (default 600)
            expires_hours: Hunt expiration in hours (default 24)
            paused: Create hunt in paused state (default True for safety)
    
        Returns:
            Hunt ID and details.
        """
        # Input validation
        if not artifacts:
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": "artifacts parameter is required and cannot be empty"
                })
            )]
    
        if not description:
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": "description parameter is required and cannot be empty"
                })
            )]
    
        if os_filter and os_filter not in ['windows', 'linux', 'darwin']:
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": f"Invalid os_filter '{os_filter}'. Must be one of: windows, linux, darwin"
                })
            )]
    
        try:
            client = get_client()
    
            # Build the artifacts list
            artifacts_str = ", ".join(f"'{a}'" for a in artifacts)
    
            # Build optional parameters
            parts = [
                f"artifacts=[{artifacts_str}]",
                f"description='{description}'",
                f"timeout={timeout}",
                f"expires=now() + {expires_hours * 3600}",
                f"pause={'true' if paused else 'false'}",
            ]
    
            if parameters:
                spec_json = json.dumps(parameters).replace("'", "\\'")
                parts.append(f"spec={spec_json}")
    
            if include_labels:
                labels_str = ", ".join(f"'{l}'" for l in include_labels)
                parts.append(f"include_labels=[{labels_str}]")
    
            if exclude_labels:
                labels_str = ", ".join(f"'{l}'" for l in exclude_labels)
                parts.append(f"exclude_labels=[{labels_str}]")
    
            if os_filter:
                parts.append(f"os='{os_filter}'")
    
            params_str = ", ".join(parts)
            vql = f"SELECT hunt({params_str}) AS hunt FROM scope()"
    
            results = client.query(vql)
    
            if not results:
                return [TextContent(
                    type="text",
                    text=json.dumps({"error": "Failed to create hunt"})
                )]
    
            hunt = results[0].get("hunt", {})
    
            return [TextContent(
                type="text",
                text=json.dumps({
                    "status": "hunt_created",
                    "hunt_id": hunt.get("hunt_id", ""),
                    "description": description,
                    "artifacts": artifacts,
                    "state": "PAUSED" if paused else "RUNNING",
                    "expires": hunt.get("expires", ""),
                }, indent=2, default=str)
            )]
    
        except grpc.RpcError as e:
            error_response = map_grpc_error(e, "hunt creation")
            return [TextContent(
                type="text",
                text=json.dumps(error_response)
            )]
        except Exception:
            # Generic errors - don't expose internals
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": "Unexpected error during hunt creation",
                    "hint": "Check Velociraptor server logs or contact administrator"
                })
            )]
Behavior4/5

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

No annotations provided, but description carries weight well: discloses 'paused' safety default (True), timeout/expiration mechanics, and per-client execution model. Missing: permission requirements, failure behavior on partial client success, or whether hunt is resource-intensive.

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?

Efficient docstring structure: single-sentence purpose, bulleted Args with essential details only, minimal Returns line. 'Returns' section appropriately brief given output schema exists. No redundant text.

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

Completeness4/5

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

Comprehensive for a 9-parameter orchestration tool: covers filtering logic, safety defaults, and artifact parameterization. Minor gap: doesn't mention that hunts are asynchronous or reference sibling get_hunt_results for retrieving output, though this may be inferred.

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, the Args block provides critical compensation: explains complex nested 'parameters' format with JSON example, lists valid 'os_filter' values, and documents defaults (timeout 600s, expires 24h). All 9 parameters semantically enriched beyond schema titles.

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?

Opens with specific verb ('Create') and resource ('Velociraptor hunt'), explicitly scopes to 'multiple clients' which distinguishes it from siblings like collect_artifact (single client) and modify_hunt (updates existing). Clear operational domain.

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

Usage Guidelines3/5

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

Provides implicit guidance through 'multiple clients' phrasing and client filtering args (include_labels, os_filter), but does not explicitly name alternatives (e.g., 'use collect_artifact for single clients') or state prerequisites like requiring artifact pre-existence.

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/wagonbomb/megaraptor-mcp'

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