Skip to main content
Glama

run_blooodhound_query

Execute BloodHound Cypher queries to analyze Active Directory attack paths and identify security vulnerabilities during penetration testing.

Instructions

Run a bloodhound cypher query of your choice (use this to collect information about the network and potentially identify attack vectors)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Implementation Reference

  • Registration of the tool using the @mcp.tool decorator.
    @mcp.tool(name="run_blooodhound_query",description="Run a bloodhound cypher query of your choice (use this to collect information about the network and potentially identify attack vectors)")
  • The tool handler function, which calls into the bloodhound module to execute the query.
    def run_bloodhound_query(query):
        return bloodhound.run_cypher_query(query)
  • Core helper function that authenticates with BloodHound CE API using HMAC-signed requests and executes the Cypher query via POST to /api/v2/graphs/cypher.
    def run_cypher_query(query):
        credentials = Credentials(
            token_id=config.BHE_TOKEN_ID,
            token_key=config.BHE_TOKEN_KEY,
        )
    
        client = Client(scheme=BHE_SCHEME, host=config.BHE_DOMAIN, port=config.BHE_PORT, credentials=credentials)
        payload={"query":query}
        data=json.dumps(payload).encode('utf-8')
        response=client._request("POST","/api/v2/graphs/cypher",body=data,content_type="application/json")
        return response.json()
Behavior2/5

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

With no annotations provided, the description carries full burden but offers limited behavioral insight. It mentions the tool can 'collect information' and 'identify attack vectors', hinting at read-only or investigative use, but doesn't disclose critical traits like whether it requires specific permissions, has rate limits, affects system state, or returns structured vs. raw data. For a tool with zero annotation coverage, this leaves significant gaps in understanding its operational impact.

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 a single, efficient sentence that front-loads the core action and purpose. It avoids redundancy and wastes no words, though it could be slightly more structured (e.g., separating usage context). Every part earns its place by explaining what the tool does and why.

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

Completeness2/5

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

Given the tool's complexity (running custom queries in a security tool), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavioral traits (e.g., safety, performance), parameter specifics, and expected outputs, which are crucial for an AI agent to use it effectively in a network reconnaissance context.

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?

The input schema has 1 parameter with 0% description coverage, so the description must compensate. It adds meaning by specifying the parameter is a 'bloodhound cypher query of your choice', clarifying it's a custom query string rather than a predefined option. However, it doesn't provide syntax examples, format details, or constraints (e.g., query length, supported cypher features), leaving the agent to infer from context. Baseline is 3 as it adds some value but not fully.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('run a bloodhound cypher query') and the resource ('information about the network'), with a specific purpose ('collect information... and potentially identify attack vectors'). It distinguishes from siblings like 'test_bloodhound_connection' or 'upload_zip_to_bloodhound' by focusing on query execution rather than setup or data ingestion. However, it doesn't explicitly differentiate from 'list_saved_quereis' (likely a typo for 'queries'), which might be related.

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 for information gathering and attack vector identification, suggesting it's for reconnaissance phases. It doesn't provide explicit when-not-to-use guidance or name alternatives among siblings (e.g., not specifying when to use this vs. 'list_saved_quereis' or other tools). The context is clear but lacks exclusions or comparative advice.

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/YoussefSahnoun/PentestMCP'

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