Skip to main content
Glama

upload_zip_to_bloodhound

Upload ZIP data to Bloodhound for Active Directory analysis and attack path discovery during penetration testing. Wait for ingestion before querying results.

Instructions

Upload data zip to bloodhound to ingest and analyze (wait until it gets ingested before testing queries)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zip_pathYes

Implementation Reference

  • Registration of the MCP tool via FastMCP decorator.
    @mcp.tool(name="upload_zip_to_bloodhound",description="Upload data zip to bloodhound to ingest and analyze (wait until it gets ingested before testing queries)")
  • Handler function that delegates the upload to the bloodhound module.
    def upload_zip_to_bloodhound(zip_path):
        return bloodhound.upload_zip(zip_path)
  • Core helper function implementing the BloodHound CE API upload flow for the zip file.
    def upload_zip(zip_path: str) -> Dict[str, Any]:
        """
        Upload a SharpHound zip (or BloodHound JSON zip) using the BHCE file-upload job flow:
          1) POST /api/v2/file-upload/start  -> get upload id
          2) POST /api/v2/file-upload/{id}   -> upload bytes (Content-Type: application/zip)
          3) POST /api/v2/file-upload/{id}/end -> finish job
    
        Returns the final job response JSON (or raises on error).
        """
    
    
        # create client
        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)
    
        p = Path(zip_path)
        if not p.exists():
            raise FileNotFoundError(f"{zip_path} not found")
    
        zip_bytes = p.read_bytes()
    
        # 1) create upload job
        resp = client._request("POST", "/api/v2/file-upload/start", content_type="application/json")
        # response body should contain the upload job id in JSON: { "data": { "id": "<id>" }, ... }
        start_payload = resp.json()
        upload_id = start_payload.get("data", {}).get("id")
        if not upload_id:
            raise RuntimeError(f"Could not create upload job: {start_payload}")
    
        # 2) upload the zip bytes (include body bytes when signing)
        upload_uri = f"/api/v2/file-upload/{upload_id}"
        client._request("POST", upload_uri, body=zip_bytes, content_type="application/zip")
        # 3) finish the job
        end_uri = f"/api/v2/file-upload/{upload_id}/end"
        end_resp = client._request("POST", end_uri, body=None, content_type="application/json")
        # API returns 204 No Content on success; depending on your client .json() may fail.
        if end_resp.status_code == 204:
            return {"status": "accepted", "upload_id": upload_id}
        else:
            return end_resp
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions that the tool waits for ingestion before queries can be tested, which adds useful behavioral context about timing and dependencies. However, it lacks details on permissions needed, error handling, rate limits, or what 'ingested' means operationally. For a mutation tool with zero annotation coverage, this is insufficient.

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 main purpose. It could be slightly more structured by separating the action from the behavioral note, but it's appropriately sized with no wasted words.

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 no annotations, no output schema, and 0% schema coverage, the description is incomplete. It covers the basic purpose and a timing note but misses critical details for a mutation tool: what happens on success/failure, output format, security implications, or error conditions. The context signals indicate high complexity that isn't addressed.

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% (no descriptions in schema), and there is 1 parameter. The description doesn't mention the 'zip_path' parameter at all, failing to add any semantic meaning beyond what the bare schema provides. However, with only 1 parameter, the baseline is higher, but the description doesn't compensate for the lack of schema documentation.

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 ('upload data zip') and purpose ('to ingest and analyze'), with the resource being Bloodhound. It distinguishes from siblings like 'bloodhound_ingest' by specifying zip upload, but doesn't explicitly differentiate from all siblings. The description is specific but could be more precise about what distinguishes it from similar tools.

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 provides implied usage guidance with 'wait until it gets ingested before testing queries', suggesting this is a prerequisite step. However, it doesn't explicitly state when to use this vs. alternatives like 'bloodhound_ingest' or 'test_bloodhound_connection', nor does it mention any exclusions or prerequisites beyond the waiting 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