connection_tracking
List active RouterOS firewall connection-table entries filtered by source, destination, port, or protocol; at least one filter is required to limit output size.
Instructions
List active connections from RouterOS's connection tracking table
(/ip/firewall/connection) - FILTERED. At least ONE of src_address,
dst_address, dst_port, protocol is REQUIRED.
WHY a filter is mandatory (unlike every other read tool in this package): on a production router, the full connection-tracking table can be large enough to blow past an LLM caller's context/token budget on its own. Calling this with no filter at all raises a ValidationError instead of returning the whole table.
Filtering happens in Python after reading the table - the same
reasoning logs' topics filter already documents (RouterOS's
structured API doesn't expose a query-by-field read here either).
src_address/dst_address match a row's IP, ignoring the port
RouterOS packs into the same field (e.g. "192.0.2.1:80" ->
address "192.0.2.1"); dst_port matches the destination's port
component. protocol is a RouterOS protocol name (e.g.
"tcp"/"udp"/"icmp", case-insensitive) or a numeric IP protocol
number (0-255).
Regardless of how many rows match, the result is capped at
MAX_CONNTRACK_LIMIT (100) entries - truncated is true whenever
more rows matched than were returned, and total_matched always
reports the real (pre-truncation) match count, so a caller always
knows whether it's seeing everything that matched.
Each returned entry: protocol, src-address/src-port,
dst-address/dst-port (address and port split apart - see
formatting.split_address_port), tcp-state (populated for TCP
connections), timeout, and the assured/confirmed/seen-reply
flags - RouterOS's own closest equivalent to a generic "connection
state" for this table.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dst_port | No | ||
| protocol | No | ||
| device_name | Yes | ||
| dst_address | No | ||
| src_address | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||