OPNsense MCP fixes: O1,O2,O4,O6 - narrow except, health check, register host, VLAN tools
This commit is contained in:
@@ -8,7 +8,7 @@ from typing import Any
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
|
||||
from opnsense_mcp.audit import audit_log
|
||||
from opnsense_mcp.client import get_client
|
||||
from opnsense_mcp.client import OpnsenseAPIError, get_client
|
||||
from opnsense_mcp.config import settings
|
||||
from opnsense_mcp.guards import is_dry_run_response, require_writes
|
||||
|
||||
@@ -17,7 +17,7 @@ def _search_nat(nat_type: str, search_phrase: str, row_count: int) -> str:
|
||||
client = get_client()
|
||||
try:
|
||||
result = client.search_get("firewall", nat_type, "searchRule", search_phrase, row_count)
|
||||
except Exception:
|
||||
except OpnsenseAPIError:
|
||||
result = client.search_grid("firewall", nat_type, "searchRule", search_phrase, row_count)
|
||||
return json.dumps(result, indent=2, default=str)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user