Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
dst_portNo
protocolNo
device_nameYes
dst_addressNo
src_addressNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.11.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and does so: it discloses the ValidationError on unfiltered calls, that filtering is done client-side in Python (not via RouterOS query-by-field), the MAX_CONNTRACK_LIMIT=100 cap, the truncated flag and total_matched pre-truncation semantics, and the exact fields returned per row. Nothing behavioral is left inferred.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose and the filter requirement, and every sentence (the WHY, the parsing rules, the truncation contract, the return shape) carries distinct information. It is on the long side with a few parenthetical asides, but there is no filler or redundancy.

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

Completeness5/5

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

For a read tool with five parameters, a mandatory-filter rule, a hard result cap, and an output schema present, the description covers the precondition, the parsing semantics, the truncation contract and even the per-row field list. An agent has everything needed to call it correctly and interpret the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate and does: src_address/dst_address match only the IP portion of RouterOS's packed 'addr:port' field, dst_port matches the destination port component, and protocol accepts either a case-insensitive RouterOS protocol name or a numeric 0-255 IP protocol number.

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 and resource ('List active connections from RouterOS's connection tracking table /ip/firewall/connection') and immediately marks the scope as FILTERED, which distinguishes it from the many unfiltered read siblings like ip_routes or firewall_filter.

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

Usage Guidelines5/5

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

Explicitly gives the when-to-use precondition — at least one of src_address/dst_address/dst_port/protocol is REQUIRED — and explains why (context/token budget risk versus every other read tool in the package), plus what happens if violated (ValidationError). That is a complete usage rule, not an implied one.

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

Deploy Server

Other Tools