Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

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)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: {} },
    },
  • 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) }] };
  • 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 }> }> {
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description must bear the full transparency burden. It mentions return metrics but does not disclose whether the operation is read-only, safe, or if it requires special permissions. The lack of annotations and limited behavioral disclosure reduces transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence of 12 words, extremely concise. It front-loads the key action and result metrics with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool, the description adequately covers the purpose and output. It lists the metrics returned, which is sufficient for an agent to understand the tool's function. However, it could mention the return format (e.g., list of interfaces) for completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has no parameters (100% coverage). The description adds value by specifying the returned statistics (bytes, packets, errors, collisions), which would not be clear from the schema alone. This compensates for the lack of parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get traffic statistics for all interfaces' and specifies the metrics (bytes, packets, errors, collisions). It distinguishes from sibling tools like opnsense_if_list (which likely lists interfaces) and opnsense_if_get (which gets interface config).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (to get stats for all interfaces) but does not explicitly contrast with alternatives or state when not to use. It lacks prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itunified-io/mcp-opnsense'

If you have feedback or need assistance with the MCP directory API, please join our Discord server