opnsense_if_stats
Retrieve traffic statistics for all network interfaces, including bytes, packets, errors, and collisions.
Instructions
Get traffic statistics for all interfaces (bytes, packets, errors, collisions)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "opnsense_if_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/interfaces.ts:63-67 (registration)Tool registration for opnsense_if_stats, defined in interfacesToolDefinitions array with no required inputs.
name: "opnsense_if_stats", description: "Get traffic statistics for all interfaces (bytes, packets, errors, collisions)", inputSchema: { type: "object" as const, properties: {} }, }, - src/tools/interfaces.ts:201-203 (handler)Handler implementation: calls the OPNsense REST API endpoint /diagnostics/interface/getInterfaceStatistics and returns the raw JSON response.
case "opnsense_if_stats": { const result = await client.get("/diagnostics/interface/getInterfaceStatistics"); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; - src/tools/interfaces.ts:148-152 (helper)The parent dispatcher function that routes tool calls (including opnsense_if_stats) to the correct case branch using a switch on the tool name.
export async function handleInterfacesTool( name: string, args: Record<string, unknown>, client: OPNsenseClient, ): Promise<{ content: Array<{ type: "text"; text: string }> }> {