Skip to main content
Glama
wagonbomb

Megaraptor MCP

by wagonbomb

list_clients

Search and list Velociraptor endpoint clients by hostname, labels, or OS to manage forensic investigations and threat hunting workflows.

Instructions

Search and list Velociraptor clients (endpoints).

Args: search: Optional search query. Supports prefixes like 'label:' and 'host:'. Examples: 'label:production', 'host:workstation-01', 'windows' limit: Maximum number of clients to return (default 100)

Returns: List of clients with their ID, hostname, OS, labels, and last seen time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchNo
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The implementation of the list_clients tool, which queries Velociraptor for clients and returns them as formatted text content.
    @mcp.tool()
    async def list_clients(
        search: Optional[str] = None,
        limit: int = 100,
    ) -> list[TextContent]:
        """Search and list Velociraptor clients (endpoints).
    
        Args:
            search: Optional search query. Supports prefixes like 'label:' and 'host:'.
                   Examples: 'label:production', 'host:workstation-01', 'windows'
            limit: Maximum number of clients to return (default 100)
    
        Returns:
            List of clients with their ID, hostname, OS, labels, and last seen time.
        """
        try:
            # Validate inputs
            limit = validate_limit(limit)
    
            # Basic injection protection for search parameter
            if search and (";" in search or "--" in search):
                return [TextContent(
                    type="text",
                    text=json.dumps({
                        "error": "Invalid search query: potentially unsafe characters detected",
                        "hint": "Remove semicolons and SQL comment markers from search query"
                    })
                )]
    
            client = get_client()
    
            if search:
                vql = f"SELECT * FROM clients(search='{search}') LIMIT {limit}"
            else:
                vql = f"SELECT * FROM clients() LIMIT {limit}"
    
            results = client.query(vql)
    
            # Format the results
            formatted = []
            for row in results:
                client_info = {
                    "client_id": row.get("client_id", ""),
                    "hostname": row.get("os_info", {}).get("hostname", ""),
                    "os": row.get("os_info", {}).get("system", ""),
                    "release": row.get("os_info", {}).get("release", ""),
                    "labels": row.get("labels", []),
                    "last_seen_at": row.get("last_seen_at", ""),
                    "first_seen_at": row.get("first_seen_at", ""),
                    "last_ip": row.get("last_ip", ""),
                }
                formatted.append(client_info)
    
            return [TextContent(
                type="text",
                text=json.dumps(formatted, indent=2)
            )]
    
        except ValueError as e:
            # Validation errors
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": str(e),
                    "hint": "Check your limit parameter value"
                })
            )]
    
        except grpc.RpcError as e:
            # gRPC errors
            error_info = map_grpc_error(e, "listing clients")
            return [TextContent(
                type="text",
                text=json.dumps(error_info, indent=2)
            )]
    
        except Exception:
            # Generic errors - don't expose internals
            return [TextContent(
                type="text",
                text=json.dumps({
                    "error": "Failed to list clients",
                    "hint": "Check Velociraptor server connection and try again"
                })
            )]
Behavior3/5

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

With no annotations provided, the description carries the full burden. It successfully discloses the read-only nature via 'Search and list' and details the return format (ID, hostname, OS, etc.), but omits safety confirmations, pagination behavior beyond the limit parameter, or rate limiting details.

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 Args/Returns structure is efficient and front-loaded. Every sentence earns its place: the opening declares purpose, the Args section details parameter semantics with examples, and the Returns section clarifies output content without redundancy.

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?

Given the tool's simplicity (2 optional parameters, no nesting) and existence of an output schema, the description is nearly complete. It could be improved by explicitly contrasting with 'get_client_info' to guide agent selection among the 30+ siblings, but adequately covers the core functionality.

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?

The schema has 0% description coverage (titles only), but the description fully compensates by documenting both parameters: it explains the search syntax with specific prefix examples (label:, host:) and clarifies the limit default (100). This adds crucial semantic meaning absent from the structured 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 opens with a clear, specific verb ('Search and list') followed by the resource ('Velociraptor clients/endpoints'). It effectively distinguishes from the sibling 'get_client_info' by emphasizing the plural listing/search capability vs. single-item retrieval.

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?

While the description provides helpful search syntax examples (label:, host:), it lacks explicit guidance on when to use this versus 'get_client_info' or other client-related tools. The examples imply usage patterns but do not explicitly state selection criteria or prerequisites.

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