Change VPS Firewall Rule
mutate_vserver_firewall_ruleAdd, update, delete or move a VPS firewall rule (positions from get_vserver_firewall). add/update need type and ruleAction; update replaces the whole rule, so send every field to keep (omitted optional fields are cleared). Requires confirm=true. Requires an active ZapX Pass (see server instructions).
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": {
"serviceId": "<serviceId>",
"action": "<action>"
},
"name": "mutate_vserver_firewall_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log | No | add/update: log level (default nolog). | |
| pos | No | update/delete/move: `pos` of the rule as returned by get_vserver_firewall. | |
| dest | No | add/update: destination address, CIDR or +ipset_name. Empty = any. | |
| type | No | add/update: traffic direction. | |
| dport | No | add/update: destination port(s), e.g. 22, 80,443 or 27015:27020. | |
| macro | No | add/update: Proxmox firewall macro instead of proto/ports, e.g. SSH, HTTP, HTTPS, DNS, Ping. | |
| proto | No | add/update: protocol, e.g. tcp, udp, icmp, icmpv6. | |
| sport | No | add/update: source port(s), e.g. 1024:65535. | |
| action | Yes | ||
| enable | No | add/update: rule active (default true). | |
| newPos | No | move: target position. add: optional insert position; default is after the existing customer rules (lowest priority, first match wins), so pass newPos to place a rule above an earlier ACCEPT. | |
| source | No | add/update: source address, CIDR or +ipset_name (IP set of this VPS). Empty = any. | |
| comment | No | add/update: free text comment. | |
| confirm | No | ||
| serviceId | Yes | ID of the VPS: the "id" field from list_account_services or list_vservers (e.g. "cmabc123..."). The numericId shown in the panel (e.g. "180") is accepted too. IDs of other service types do not work here. | |
| ruleAction | No | add/update: what the rule does with matching traffic. |