opnsense_if_list
Retrieve all network interface names and their device mappings from OPNsense firewall. Useful for identifying interface configurations or troubleshooting network setup.
Instructions
List all network interface names and their device mappings
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/interfaces.ts:155-158 (handler)Handler for the 'opnsense_if_list' tool. Calls OPNsense API endpoint /diagnostics/interface/getInterfaceNames and returns the result as JSON.
case "opnsense_if_list": { const result = await client.get("/diagnostics/interface/getInterfaceNames"); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/interfaces.ts:42-44 (registration)Tool definition registration for 'opnsense_if_list' with name, description, and empty inputSchema (no args required).
{ name: "opnsense_if_list", description: "List all network interface names and their device mappings", - src/index.ts:62-62 (registration)Registration of handleInterfacesTool as the handler for all interface tool definitions (including opnsense_if_list) in the tool handler map.
for (const def of interfacesToolDefinitions) toolHandlers.set(def.name, handleInterfacesTool); - src/tools/interfaces.ts:45-45 (schema)Input schema for opnsense_if_list: an empty object schema (no parameters required).
inputSchema: { type: "object" as const, properties: {} }, - src/client/opnsense-client.ts:28-35 (helper)The OPNsenseClient.get() method used by the handler to make the API GET request to /diagnostics/interface/getInterfaceNames.
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}`); } }