opnsense_fw_list_aliases
Lists all OPNsense firewall aliases including host groups, networks, ports, and URLs for inventory or configuration management.
Instructions
List all firewall aliases (host groups, networks, ports, URLs)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/firewall.ts:368-371 (handler)Handler for opnsense_fw_list_aliases — calls OPNsense API GET /firewall/alias/searchItem and returns the raw JSON result.
case "opnsense_fw_list_aliases": { const result = await client.get("/firewall/alias/searchItem"); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/firewall.ts:182-185 (registration)Tool definition registration for opnsense_fw_list_aliases — declares name, description, and empty inputSchema in the firewallToolDefinitions array.
name: "opnsense_fw_list_aliases", description: "List all firewall aliases (host groups, networks, ports, URLs)", inputSchema: { type: "object" as const, properties: {} }, }, - src/index.ts:60-60 (registration)Registers the firewall tool handler into the toolHandlers map. Maps all firewall tool names (including opnsense_fw_list_aliases) to the handleFirewallTool function.
for (const def of firewallToolDefinitions) toolHandlers.set(def.name, handleFirewallTool); - src/client/opnsense-client.ts:28-35 (helper)OPNsenseClient.get method — used by the handler to make the GET request to /firewall/alias/searchItem.
async get<T>(path: string): Promise<T> { try { const response = await this.http.get<T>(path); return response.data; } catch (error: unknown) { throw extractError(error, `GET ${path}`); } } - src/utils/validation.ts:48-54 (helper)Shared validation schemas (ProtocolSchema, FirewallActionSchema, DirectionSchema) used elsewhere in the firewall module but not directly needed for list_aliases.
export const ProtocolSchema = z.enum(["TCP", "UDP", "ICMP", "any"]); export const FirewallActionSchema = z.enum(["pass", "block", "reject"]); export const DirectionSchema = z.enum(["in", "out"]); export const ServiceActionSchema = z.enum(["start", "stop", "restart"]);