Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_dns_flush_zone

Flush all cached DNS entries for a specific domain to clear stale SERVFAIL or outdated records. Restarts Unbound for complete cache clearing.

Instructions

Flush all cached DNS entries for a specific domain/zone. Use this to clear stale SERVFAIL or outdated records for a domain. Restarts Unbound to ensure complete cache clearing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain/zone to flush (e.g. 'example.com')

Implementation Reference

  • Zod schema for opnsense_dns_flush_zone input validation. Expects a 'domain' string conforming to DomainSchema (valid domain name format).
    const DnsFlushZoneSchema = z.object({
      domain: DomainSchema,
    });
  • Tool definition registration for 'opnsense_dns_flush_zone' in the dnsToolDefinitions array. Declares name, description, and inputSchema with required 'domain' property.
    {
      name: "opnsense_dns_flush_zone",
      description:
        "Flush all cached DNS entries for a specific domain/zone. Use this to clear stale SERVFAIL or outdated records for a domain. Restarts Unbound to ensure complete cache clearing.",
      inputSchema: {
        type: "object" as const,
        properties: {
          domain: { type: "string", description: "Domain/zone to flush (e.g. 'example.com')" },
        },
        required: ["domain"],
      },
    },
  • Handler implementation for opnsense_dns_flush_zone. Parses domain from args via DnsFlushZoneSchema, then flushes the full Unbound cache and restarts Unbound (reconfigure) because OPNsense has no per-zone flush API.
    case "opnsense_dns_flush_zone": {
      const { domain } = DnsFlushZoneSchema.parse(args);
      // OPNsense doesn't expose per-zone flush via API.
      // Flush full cache then restart Unbound to clear infra cache too.
      await client.post("/unbound/service/flushcache");
      const result = await client.post("/unbound/service/reconfigure");
      return {
        content: [
          {
            type: "text",
            text: `Flushed DNS cache and restarted Unbound to clear all cached entries for ${domain}. Full cache and infrastructure cache cleared.`,
          },
        ],
      };
    }
  • src/index.ts:59-59 (registration)
    Maps the tool name 'opnsense_dns_flush_zone' to the handleDnsTool handler function for MCP call routing.
    for (const def of dnsToolDefinitions) toolHandlers.set(def.name, handleDnsTool);
Behavior3/5

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

The description mentions 'Restarts Unbound to ensure complete cache clearing,' disclosing a side effect. However, it lacks details on potential service disruption, required privileges, or error conditions. Given no annotations, it does the minimum but could be more thorough.

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 two sentences with no wasted words. It front-loads the action and then provides usage context and side effects. Every sentence serves a purpose.

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 simple tool with no annotations and no output schema, the description covers purpose, usage, and a key side effect. It does not address prerequisites or failure modes, but overall it is sufficient for an agent to decide and invoke correctly.

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%, and the parameter description in the schema is already clear. The description adds 'for a specific domain/zone,' which reinforces the parameter meaning but does not provide additional semantic depth beyond the schema.

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 'Flush all cached DNS entries for a specific domain/zone' with a specific verb (flush) and resource (domain-zone DNS cache). It distinguishes from the sibling 'opnsense_dns_flush_cache' by targeting a single domain, not the entire cache.

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

Usage Guidelines4/5

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

The description provides a clear use case: 'Use this to clear stale SERVFAIL or outdated records for a domain.' However, it does not explicitly compare with 'opnsense_dns_flush_cache' or state when not to use it, leaving the distinction implicit.

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