Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_diag_traceroute

Run a traceroute diagnostic from your OPNsense firewall to any IP address or hostname to trace the network path.

Instructions

Run a traceroute from the OPNsense firewall to a destination

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesIP address or hostname to traceroute

Implementation Reference

  • Zod schema for traceroute input validation — requires a non-empty 'address' string.
    const TracerouteSchema = z.object({
      address: z.string().min(1, "Address is required"),
    });
  • Tool definition registered in diagnosticsToolDefinitions array — defines name, description, and input schema for the MCP ListTools response.
    {
      name: "opnsense_diag_traceroute",
      description: "Run a traceroute from the OPNsense firewall to a destination",
      inputSchema: {
        type: "object" as const,
        properties: {
          address: {
            type: "string",
            description: "IP address or hostname to traceroute",
          },
        },
        required: ["address"],
      },
    },
  • Handler for the traceroute tool — validates args with TracerouteSchema, then calls POST /diagnostics/traceroute/set on the OPNsense API (synchronous in 24.7+).
    case "opnsense_diag_traceroute": {
      const parsed = TracerouteSchema.parse(args);
    
      // OPNsense 24.7+: set is synchronous — executes traceroute and returns results
      const result = await client.post("/diagnostics/traceroute/set", {
        traceroute: {
          settings: {
            hostname: parsed.address,
          },
        },
      });
    
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • Main dispatch function that routes tool calls by name to the correct case block — the traceroute case is handled at line 357.
    export async function handleDiagnosticsTool(
      name: string,
      args: Record<string, unknown>,
      client: OPNsenseClient,
    ): Promise<{ content: Array<{ type: "text"; text: string }> }> {
  • src/index.ts:83-95 (registration)
    MCP CallTool handler dispatches to the handler function retrieved from toolHandlers map — the diagnostics tools (including traceroute) are registered at line 61.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
      const handler = toolHandlers.get(name);
    
      if (!handler) {
        return {
          content: [{ type: 'text' as const, text: `Unknown tool: ${name}` }],
          isError: true,
        };
      }
    
      return handler(name, (args ?? {}) as Record<string, unknown>, client);
    });
Behavior2/5

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

No annotations provided, so description must fully disclose behavior. It does not mention that traceroute is potentially long-running, requires network access, or that it is a read-only operation. No details on timeouts, rate limits, or error handling.

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

Conciseness4/5

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

Single sentence, concise and front-loaded. However, for a simple tool, the brevity is appropriate; no wasted words.

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

Completeness2/5

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

No output schema, yet description does not explain return values or format. Given many sibling diagnostic tools, additional context about use cases or output would improve completeness.

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

Parameters3/5

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

Input schema covers 100% of parameters, with address described as 'IP address or hostname to traceroute'. Description adds no extra semantics beyond the schema, meeting baseline expectations.

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?

Description clearly states the action (run a traceroute) and the resource (from the OPNsense firewall to a destination). Among sibling diagnostic tools like ping, dns_lookup, and arp_table, it uniquely identifies the traceroute functionality.

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

Usage Guidelines2/5

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

No guidance on when to use this tool versus other diagnostic tools (e.g., ping, routes). No mention of prerequisites, error conditions, or alternative tools for similar tasks.

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