Skip to main content
Glama
itunified-io

mcp-opnsense

by itunified-io

opnsense_dns_cache_search

Search the Unbound DNS cache for a domain to diagnose cached SERVFAIL, stale records, or verify cache state.

Instructions

Search the Unbound DNS cache for entries matching a domain. Useful for diagnosing cached SERVFAIL, stale records, or verifying cache state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain to search for in cache (e.g. 'example.com')

Implementation Reference

  • Handler case for 'opnsense_dns_cache_search' in the handleDnsTool switch. Parses args via DnsCacheSearchSchema, calls GET /unbound/diagnostics/dumpcache, filters lines for the domain, and returns matching cache entries.
    case "opnsense_dns_cache_search": {
      const { domain } = DnsCacheSearchSchema.parse(args);
      const cache = await client.get("/unbound/diagnostics/dumpcache");
      const cacheStr = typeof cache === "string" ? cache : JSON.stringify(cache);
      // Filter cache lines matching the domain
      const lines = cacheStr.split("\n").filter((line: string) =>
        line.toLowerCase().includes(domain.toLowerCase()),
      );
      if (lines.length === 0) {
        return {
          content: [{ type: "text", text: `No cache entries found matching '${domain}'` }],
        };
      }
      return {
        content: [
          {
            type: "text",
            text: `Cache entries matching '${domain}' (${lines.length} found):\n${lines.join("\n")}`,
          },
        ],
      };
    }
  • Zod schema DnsCacheSearchSchema defining the input: a required 'domain' string.
    const DnsCacheSearchSchema = z.object({
      domain: z.string().min(1, "Domain filter is required"),
    });
  • src/index.ts:39-40 (registration)
    Tool definition included in allToolDefinitions (spread from dnsToolDefinitions).
    const allToolDefinitions = [
      ...dnsToolDefinitions,
  • src/index.ts:59-59 (registration)
    Handler registration: maps each DNS tool definition name to handleDnsTool.
    for (const def of dnsToolDefinitions) toolHandlers.set(def.name, handleDnsTool);
  • Tool definition entry for 'opnsense_dns_cache_search' in dnsToolDefinitions array, with description and inputSchema.
    {
      name: "opnsense_dns_cache_search",
      description:
        "Search the Unbound DNS cache for entries matching a domain. Useful for diagnosing cached SERVFAIL, stale records, or verifying cache state.",
      inputSchema: {
        type: "object" as const,
        properties: {
          domain: { type: "string", description: "Domain to search for in cache (e.g. 'example.com')" },
        },
        required: ["domain"],
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not specify whether the operation is read-only or modifies cache state, nor does it mention permissions or side effects. This is a significant gap for a diagnostic tool.

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 extremely concise: two sentences with no fluff. The first sentence states the primary action, and the second lists use cases. All information is front-loaded.

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

Completeness3/5

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

For a simple one-parameter search tool, the description covers purpose and use cases but omits any information about the output format or return value. Since there is no output schema, this is a notable gap. Complete enough for basic use but could benefit from additional context.

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?

The input schema already provides a clear description for the single parameter 'domain', and the description confirms it searches for matching entries. No additional meaning is added beyond the schema, so baseline 3 is appropriate.

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 action 'Search the Unbound DNS cache' and names the specific resource (Unbound DNS cache). It lists use cases like diagnosing cached SERVFAIL, stale records, or verifying cache state, distinguishing it from sibling tools such as opnsense_dns_flush_cache and opnsense_diag_dns_lookup.

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 practical contexts for use (e.g., diagnosing cached errors, verifying cache state) and implicitly contrasts with siblings like flush_cache or DNS lookup tools. Lacks explicit when-not-to-use statements, but the use cases are clear enough.

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