Add a firewall rule
mikrotik_firewall_add_ruleAdds a MikroTik firewall rule to a selected chain and table, accepting rule properties and optional placement above an existing rule.
Instructions
Add a firewall rule. properties takes any rule property (src-address, dst-port, protocol, in-interface, connection-state, to-addresses, ...). Use placeBefore with a rule .id to insert it above an existing rule; otherwise it is appended to the end of the table.
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": "mikrotik_firewall_add_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ipv6 | No | ||
| chain | Yes | ||
| table | No | filter | |
| action | Yes | e.g. "accept", "drop", "reject", "masquerade", "dst-nat", "add-src-to-address-list" | |
| device | No | Name of the configured device. Defaults to the first device (see mikrotik_list_devices). | |
| comment | No | ||
| properties | No | ||
| placeBefore | No |