opnsense_control_service
Start, stop, or restart OPNsense firewall services to apply changes or resolve issues. Confirms before disruptive stops that can break DNS or VPN tunnels.
Instructions
Start, stop or restart a service on the firewall.
Requires OPNSENSE_ALLOW_WRITE=true. Stopping a service is disruptive: stopping unbound breaks DNS for every client behind the firewall, and stopping a VPN service drops its tunnels. Confirm the intent before calling with action='stop'.
Args: params (ControlServiceInput): Validated input containing: - name (str): Service id, e.g. "unbound" - action (str): "start", "stop" or "restart" - service_id (str): Instance id for multi-instance services (default: "") - response_format (ResponseFormat): 'markdown' or 'json'
Returns: str: Confirmation text, or JSON: {"result": str, "service": str, "action": str}
Error Handling: - Returns a write-disabled explanation when OPNSENSE_ALLOW_WRITE is not set - Returns a 403 privilege message when the API key cannot control services
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": {
"params": "<params>"
},
"name": "opnsense_control_service"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |