Skip to main content
Glama

packet_entropy

Calculates Shannon entropy of PCAP packet payloads to detect randomness, distinguishing plaintext or structured data from encrypted, compressed malware or C2 traffic.

Instructions

Calculates Shannon entropy (0.0 to 8.0 bits/byte) to evaluate payload randomness and distinguish between plaintext, structured data (JSON/HTML/code), and encrypted / compressed malware or C2 traffic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputNoBase64-encoded PCAP file bytes (max 10MB).
filePathNoAbsolute path to a PCAP file on disk (local stdio only).
packetIndexNoOptional zero-based packet index to calculate entropy for a single packet payload.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

B3.3/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It explains the output range (0.0 to 8.0 bits/byte) and the interpretive meaning, which is useful, but does not disclose critical behavioral traits: whether it processes an entire PCAP or a single packet by default, whether it requires a local file or accepts base64, any rate limits or size constraints beyond what the schema states, or whether the operation is read-only or has side effects. For a tool with zero annotation coverage, this is a significant gap.

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 description is a single, front-loaded sentence that states the purpose and interprets the metric's output range and meaning. Every clause earns its place; there is no redundancy or filler.

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

Completeness3/5

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

Given the tool's moderate complexity (3 optional parameters, no output schema) and the presence of no annotations, the description covers the core concept and output range but omits behavioral details such as default scope (single packet vs. full PCAP), performance constraints, and usage context relative to sibling detection tools. It is minimally viable but leaves gaps for an agent to infer correct invocation.

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 100%, so the schema already documents all three parameters (input, filePath, packetIndex) with clear descriptions including type, format, and constraints. The description adds no parameter-level detail beyond what is in the schema, so the baseline of 3 is appropriate.

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?

States a specific verb (calculates) and resource (Shannon entropy of packet payloads), and explains its analytical role: distinguishing plaintext, structured data, and encrypted/compressed malware or C2 traffic. This differentiates it from siblings like packet_detect_beacons or packet_ja3_fingerprints by framing the output as a randomness metric rather than a detection or extraction result.

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

Usage Guidelines2/5

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

The description implies when entropy is useful (evaluating payload randomness), but does not explicitly state when to choose this tool over alternatives such as packet_detect_beacons or packet_ja3_fingerprints, nor does it provide any exclusions or prerequisites. No guidance on input selection (PCAP bytes vs. file path vs. packetIndex) is given beyond what the schema provides.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.