Capture file metadata (writer, interfaces, drops)
capture_metadataReads capture-file metadata without decoding packets to report drops, snaplen, capture filters, writer tool/OS, interfaces, statistics, and plain-language issues.
Instructions
What the capture file says about itself, read from the pcapng blocks without
decoding a packet: did the capture box drop packets, which snaplen and capture filter
were used, which tool and OS wrote the file, which interfaces are in it. file:
format, version, byte order, compression, section count. writer: the section
header's application, OS, hardware and comment. interfaces[]: id, name,
description, link type, snaplen, timestamp resolution and offset, capture filter, and
from the Interface Statistics Block (tshark has no field for it) statistics.received,
dropped_by_interface, dropped_by_os, accepted_by_filter, delivered with their
timestamps; plus packets, bytes, first/last packet, packets cut to the snaplen,
timestamps going backwards, and when the first packet came relative to interface 0.
drops_total sums the drop counters (absent when no statistics block was written).
packet_comments: count and the first five. issues in plain words (drops, a tiny
snaplen, a capture filter, no statistics block, concatenated sections). A legacy pcap
returns its header with metadata_available: false. Bounded by the file size cap and
the run timeout; strings come from the file's writer and are untrusted.
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": {
"path": "<path>"
},
"name": "capture_metadata"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Capture file (absolute, in an allowed dir) or open_capture handle | |
| redact | No | Replace subscriber identifiers in this result with tokens; ids+ips hides every IP too | off |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| note | No | ||
| path | No | ||
| error | No | ||
| issues | No | ||
| window | No | ||
| writer | No | ||
| packets | No | ||
| sections | No | ||
| interfaces | No | rows with keys: id, section, name, description, link_type, link_type_name, snaplen, timestamp_resolution, timestamp_offset_s, capture_filter, statistics, packets, bytes, first, last, truncated_packets, timestamps_backwards, first_packet_after_interface_0_s | |
| drops_total | No | ||
| read_warnings | No | ||
| packet_comments | No | ||
| metadata_available | No |