Filter packets
filter_packetsSelect packets in a capture with a Wireshark display filter and return rows of chosen tshark fields, covering protocols that dedicated tools do not handle.
Instructions
Return packets matching a Wireshark display filter as rows of fields. Default
fields: frame.number, frame.time_epoch, ip.src, ip.dst, _ws.col.protocol, _ws.col.info.
Pass fields (tshark field names such as "diameter.cmd.code") to choose your own;
unknown names are rejected. Multiple occurrences of a field are joined with commas.
Use this for anything the dedicated protocol tools do not cover.
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>",
"display_filter": "<display_filter>"
},
"name": "filter_packets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Same forms as start | |
| path | Yes | Capture file (absolute, in an allowed dir) or open_capture handle | |
| limit | No | Most rows per page | |
| start | No | ISO 8601, epoch s, +Ns from start, -Ns from end | |
| fields | No | tshark field names to return per packet (default: a short summary) | |
| offset | No | Rows to skip (next_offset) | |
| output | No | summary: all but rows, plus 3 rows (<8 KB) | rows |
| redact | No | Replace subscriber identifiers in this result with tokens; ids+ips hides every IP too | off |
| columns | No | Row keys to keep (frame keys stay) | |
| max_output_kb | No | Lower output cap, KB | |
| display_filter | Yes | Wireshark display filter selecting the packets |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | ||
| error | No | ||
| fields | No | ||
| offset | No | ||
| window | No | ||
| dropped | No | ||
| packets | No | ||
| has_more | No | ||
| returned | No | ||
| next_offset | No | ||
| total_found | No | ||
| total_matched | No | ||
| display_filter | No | ||
| packets_matched | No | ||
| packets_scanned | No | ||
| total_is_lower_bound | No |