Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

label_client

Add or remove labels from Velociraptor clients to organize endpoints for forensic investigations and threat hunting workflows.

Instructions

Add or remove labels from a Velociraptor client.

Args: client_id: The client ID (e.g., 'C.1234567890abcdef') labels: List of label names to add or remove operation: Either 'add' or 'remove' (default: 'add')

Returns: Updated client labels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
client_idYes
labelsYes
operationNoadd

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool 'label_client' is registered with '@mcp.tool()' and implements label management using Velociraptor VQL.
    @mcp.tool()
    async def label_client(
        client_id: str,
        labels: list[str],
        operation: str = "add",
    ) -> list[TextContent]:
        """Add or remove labels from a Velociraptor client.
    
        Args:
            client_id: The client ID (e.g., 'C.1234567890abcdef')
            labels: List of label names to add or remove
            operation: Either 'add' or 'remove' (default: 'add')
    
        Returns:
            Updated client labels.
        """
        try:
            # Validate client_id
            client_id = validate_client_id(client_id)
    
            if operation not in ("add", "remove"):
                return [TextContent(
                    type="text",
                    text=json.dumps({
                        "error": "Operation must be 'add' or 'remove'",
                        "hint": "Use operation='add' to add labels or operation='remove' to remove them"
                    })
                )]
    
            client = get_client()
    
            # Build the VQL for label modification
            labels_str = ", ".join(f"'{label}'" for label in labels)
    
            if operation == "add":
                vql = f"SELECT label(client_id='{client_id}', labels=[{labels_str}], op='set') FROM scope()"
            else:
                vql = f"SELECT label(client_id='{client_id}', labels=[{labels_str}], op='remove') FROM scope()"
    
            results = client.query(vql)
    
            # Get updated client info
            info_vql = f"SELECT labels FROM clients(client_id='{client_id}')"
            info_results = client.query(info_vql)
    
            return [TextContent(
                type="text",
                text=json.dumps({
                    "client_id": client_id,
                    "operation": operation,
                    "labels_modified": labels,
                    "current_labels": info_results[0].get("labels", []) if info_results else [],
                }, indent=2)
            )]
    
        except ValueError as e:
            # Validation errors
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": str(e),
                    "hint": "Provide a valid client ID starting with 'C.'"
                })
            )]
    
        except grpc.RpcError as e:
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that this is a mutation operation (add/remove) and documents the return value ('Updated client labels'), but lacks details on permissions required, idempotency, side effects of removal, or error behaviors.

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 front-loaded purpose followed by Args and Returns sections. While the Args section is verbose, this is necessary given the complete lack of schema documentation; every line provides essential parameter semantics.

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?

For a simple 3-parameter mutation tool with no nested objects, the description is complete. It explains the operation, documents all inputs (compensating for empty schema), and describes the return value, covering all necessary context for invocation.

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 description fully compensates by documenting all three parameters in the Args section: client_id includes an example format ('C.1234567890abcdef'), labels explains the list semantics, and operation specifies allowed values and defaults.

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 opens with a clear, specific action: 'Add or remove labels from a Velociraptor client.' It identifies the specific resource (labels), the target (Velociraptor client), and the verbs (add/remove), clearly distinguishing it from sibling tools like get_client_info, quarantine_client, or list_clients.

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?

The description implies usage through the 'operation' parameter documentation ('add' or 'remove'), but provides no explicit guidance on when to use this tool versus alternatives, prerequisites (e.g., client must exist), or when not to use it.

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