Skip to main content
Glama

wireshark_dissector

Generate a Wireshark Lua dissector for an inferred USB protocol, labeling commands, decoding values and checksums, and flagging checksum errors in packet captures.

Instructions

Generate a Wireshark Lua dissector for the inferred protocol.

Read-only: returns Lua source as text. Labels commands, decodes values/counters/lookups, and verifies checksums (usbrea.checksum_ok + expert warning). Load with wireshark -X lua_script:<file>.lua capture.pcapng or the same flag on tshark. Prefer scaffold_driver for a pyusb driver; prefer hid_descriptor to inspect HID report layouts.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "capture": "<capture>"
    },
    "name": "wireshark_dissector"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoWireshark protocol/filter prefix (fields become <name>.command, <name>.checksum_ok, …)usbrea
deviceNoUSB device address to analyse; default = bus address with the most host→device payloads
labelsNoMarker-free mode: ';'-separated labels in click order, or a text file path (one label per line)
captureYesPath to a usbmon or USBPcap pcap/pcapng file
markersNoMarkers JSON path; default <capture>.actions.json. Ignored when labels is set

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.2.1
    • addedInput schema / properties / capture / description
      Added value: +"Path to a usbmon or USBPcap pcap/pcapng file"
    • addedInput schema / properties / device / description
      Added value: +"USB device address to analyse; default = bus address with the most host→device payloads"
    • addedInput schema / properties / labels
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Marker-free mode: ';'-separated labels in click order, or a text file path (one label per line)",
      +  "title": "Labels"
      +}
    • addedInput schema / properties / markers / description
      Added value: +"Markers JSON path; default <capture>.actions.json. Ignored when labels is set"
    • addedInput schema / properties / name / description
      Added value: +"Wireshark protocol/filter prefix (fields become <name>.command, <name>.checksum_ok, …)"
  2. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it declares 'Read-only: returns Lua source as text', describes what the generated dissector does (labels commands, decodes values/counters/lookups, verifies checksums with usbrea.checksum_ok + expert warning), and gives the exact load invocation for wireshark/tshark. It omits auth requirements, rate limits, or behavior when the capture cannot be parsed, which keeps it out of 5 territory.

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?

Front-loads the action in the first sentence, then layers output type, generated behavior, load command, and sibling routing in three compact sentences with no filler. Every sentence earns its place.

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?

For a code-generation tool with a full output schema and 100% parameter coverage, the description supplies the missing operational context: what the artifact is, what it verifies, and how to run it. Minor gaps remain (no mention of what happens on an unparseable capture or of the markers/labels precedence, though the schema covers the latter).

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 all five parameters are already documented in the schema (including defaults, the usbrea prefix, and marker/label precedence). The description adds essentially no parameter-level meaning beyond echoing the usbrea.checksum_ok field name, so the baseline 3 applies.

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 (Generate) and resource (Wireshark Lua dissector for the inferred protocol), and immediately distinguishes itself from siblings by naming scaffold_driver and hid_descriptor with their respective purposes. An agent can route correctly without opening any schema.

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

Usage Guidelines4/5

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

Explicitly names two alternatives and the conditions that select them ('prefer scaffold_driver for a pyusb driver; prefer hid_descriptor to inspect HID report layouts'), which is strong routing guidance. It stops short of stating the positive trigger condition for this tool (e.g. 'use when you want to inspect the capture inside Wireshark'), so it is not a full when/when-not/alternatives treatment.

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