create_filter_rule
Creates a firewall filter rule in a specified MikroTik chain to match traffic by addresses, ports, protocol, interfaces, or connection state and apply accept/drop/reject actions.
Instructions
Creates a firewall filter rule in the specified chain on the MikroTik device.
Notes: connection_state: comma-separated e.g. "established,related,new,invalid" limit: RouterOS rate/burst string e.g. "10,5:packet" or "10/1s:packet" tcp_flags: RouterOS flag expression e.g. "syn,!ack" place_before: rule number or ID (*N) to insert before e.g. "0" or "*3" in_interface_list/out_interface_list: name of an /interface list (e.g. "LAN", "WAN") rather than a single interface
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": {
"chain": "<chain>",
"action": "<action>"
},
"name": "create_filter_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log | No | ||
| chain | Yes | ||
| limit | No | ||
| action | Yes | ||
| device | No | ||
| comment | No | ||
| disabled | No | ||
| dst_port | No | ||
| protocol | No | ||
| src_port | No | ||
| tcp_flags | No | ||
| log_prefix | No | ||
| dst_address | No | ||
| src_address | No | ||
| in_interface | No | ||
| place_before | No | ||
| out_interface | No | ||
| connection_state | No | ||
| dst_address_list | No | ||
| src_address_list | No | ||
| in_interface_list | No | ||
| out_interface_list | No | ||
| connection_nat_state | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |