Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_diag_dns_lookup

Resolve a hostname by performing a DNS lookup directly from the OPNsense firewall. Returns DNS records for troubleshooting network issues.

Instructions

Perform a DNS lookup from the OPNsense firewall

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostnameYesHostname to look up

Implementation Reference

  • Tool registration definition in the diagnosticsToolDefinitions array. Defines the tool name, description, and input schema (hostname required).
    {
      name: "opnsense_diag_dns_lookup",
      description: "Perform a DNS lookup from the OPNsense firewall",
      inputSchema: {
        type: "object" as const,
        properties: {
          hostname: {
            type: "string",
            description: "Hostname to look up",
          },
        },
        required: ["hostname"],
      },
    },
  • Zod schema for DNS lookup input validation. Requires a non-empty 'hostname' field.
    const DnsLookupSchema = z.object({
      hostname: z.string().min(1, "Hostname or IP address is required"),
    });
  • Handler case within handleDiagnosticsTool function. Parses args via DnsLookupSchema, then makes a GET request to the OPNsense reverse_lookup API endpoint. Returns the result as formatted JSON.
    case "opnsense_diag_dns_lookup": {
      const parsed = DnsLookupSchema.parse(args);
    
      // OPNsense 24.7+: use reverse_lookup for IP→hostname resolution
      // Forward lookup (hostname→IP) is not available via API in 24.7
      const result = await client.get(
        `/diagnostics/dns/reverse_lookup?address=${encodeURIComponent(parsed.hostname)}`,
      );
      return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
    }
  • src/index.ts:61-61 (registration)
    Registration in the MCP server: maps all diagnostics tool names (including opnsense_diag_dns_lookup) to the handleDiagnosticsTool handler function.
    for (const def of diagnosticsToolDefinitions) toolHandlers.set(def.name, handleDiagnosticsTool);
Behavior2/5

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

Without annotations, the description must disclose behavioral traits. It only states 'perform a DNS lookup' but omits details like whether it uses cached data, respects TTLs, required network connectivity, or output format. This is insufficient for an agent to predict behavior.

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?

The description is a single, efficient sentence with no wasted words. It is front-loaded with the key action. However, it could be slightly more informative without losing conciseness.

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?

Given the tool's simplicity (1 param, no output schema, no annotations), the description should at least mention return format or side effects. It fails to provide enough context for an agent to use it correctly without external knowledge.

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?

Schema coverage is 100% (hostname described in schema). The description adds no extra meaning beyond the schema. Baseline 3 is appropriate for a simple single-parameter tool.

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 verb (Perform), resource (DNS lookup), and context (from the OPNsense firewall). It distinguishes itself from sibling tools like opnsense_diag_reverse_dns by implying forward lookup.

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?

The description provides no guidance on when to use this tool versus alternatives like opnsense_diag_reverse_dns, ping, or traceroute. No mention of prerequisites, limitations, or context.

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