Skip to main content
Glama
rosschurchill

Technitium MCP Secure

dns_list_records

List DNS records in a zone, optionally filter by a specific domain name.

Instructions

List DNS records in a zone. Optionally filter by a specific domain name within the zone. When no domain is specified, returns all records across all zones matching the zone name (including subzones like app.example.com when zone=example.com). When domain is specified, returns records for that exact domain only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zoneYesZone domain name (e.g. example.com). Can be a parent domain to list all subzones.
domainNoOptional specific domain to filter (e.g. www.example.com). Defaults to the zone name if omitted.

Implementation Reference

  • Handler function for the dns_list_records tool. Takes zone (required) and optional domain parameters. If domain is specified, queries that exact domain. Otherwise finds all matching zones (parent + subzones), exports each via BIND format, and parses the results.
    handler: async (args) => {
      const zone = validateDomain(args.zone as string);
    
      if (args.domain) {
        // Specific domain requested — query that domain directly
        const domain = validateDomain(args.domain as string);
        const data = await client.callOrThrow("/api/zones/records/get", {
          zone,
          domain,
        });
        return JSON.stringify(data, null, 2);
      }
    
      // No domain specified — find all zones that match or are subzones of the requested name
      const zoneList = await client.callOrThrow("/api/zones/list");
      const allZones = (
        zoneList.zones as Array<{ name: string; internal: boolean }>
      ).filter(
        (z) =>
          !z.internal &&
          (z.name === zone || z.name.endsWith("." + zone))
      );
    
      if (allZones.length === 0) {
        // No matching zones — fall back to direct query (will surface API error if zone missing)
        const data = await client.callOrThrow("/api/zones/records/get", {
          zone,
          domain: zone,
        });
        return JSON.stringify(data, null, 2);
      }
    
      if (allZones.length === 1 && allZones[0].name === zone) {
        // Exact single zone — export to get ALL records (apex + subdomains)
        const bindText = await client.callRawTextGet("/api/zones/export", {
          zone,
        });
        return JSON.stringify(
          { zone, records: parseBind(zone, bindText) },
          null,
          2
        );
      }
    
      // Multiple zones or parent-level query — export each and combine
      const results: unknown[] = [];
      for (const z of allZones) {
        try {
          const bindText = await client.callRawTextGet("/api/zones/export", {
            zone: z.name,
          });
          results.push({ zone: z.name, records: parseBind(z.name, bindText) });
        } catch (e) {
          results.push({ zone: z.name, error: String(e) });
        }
      }
      return JSON.stringify(
        { totalZones: results.length, zones: results },
        null,
        2
      );
    },
  • Input schema for dns_list_records: requires 'zone' (string), optional 'domain' (string).
    inputSchema: {
      type: "object",
      properties: {
        zone: {
          type: "string",
          description:
            "Zone domain name (e.g. example.com). Can be a parent domain to list all subzones.",
        },
        domain: {
          type: "string",
          description:
            "Optional specific domain to filter (e.g. www.example.com). Defaults to the zone name if omitted.",
        },
      },
      required: ["zone"],
    },
  • The dns_list_records tool is registered as part of the recordTools array export in src/tools/records.ts.
    export function recordTools(client: TechnitiumClient): ToolEntry[] {
      return [
  • recordTools is included in the global getAllTools aggregation, which registers all tools.
    export function getAllTools(client: TechnitiumClient): ToolEntry[] {
      return [
        ...dashboardTools(client),
        ...dnsClientTools(client),
        ...zoneTools(client),
        ...recordTools(client),
        ...blockingTools(client),
        ...cacheTools(client),
        ...settingsTools(client),
        ...logTools(client),
        ...appTools(client),
        ...dnssecTools(client),
      ];
    }
  • Helper function that parses BIND-format zone export text into structured record objects used by the handler.
    function parseBind(
      zone: string,
      bindText: string
    ): Array<{ name: string; ttl: number; type: string; value: string }> {
      const records: Array<{ name: string; ttl: number; type: string; value: string }> = [];
      const origin = zone.endsWith(".") ? zone : zone + ".";
    
      for (const raw of bindText.split("\n")) {
        const line = raw.trim();
        if (!line || line.startsWith(";") || line.startsWith("$")) continue;
    
        // Format: <name> <ttl> IN <type> <rdata...>
        const parts = line.split(/\s+/);
        if (parts.length < 5) continue;
        const [name, ttlStr, , type, ...rdata] = parts;
        const ttl = parseInt(ttlStr, 10);
        if (isNaN(ttl)) continue;
    
        const fqdn =
          name === "@" ? zone : name.includes(".") ? name.replace(/\.$/, "") : `${name}.${zone}`;
    
        records.push({ name: fqdn, ttl, type, value: rdata.join(" ") });
      }
    
      return records;
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.2.0
    • changedInput schema / properties / domain / description
      Previous value: -"Optional specific domain to filter (e.g. www.theshellnet.com)"New value: +"Optional specific domain to filter (e.g. www.example.com). Defaults to the zone name if omitted."
    • changedInput schema / properties / zone / description
      Previous value: -"Zone domain name (e.g. theshellnet.com)"New value: +"Zone domain name (e.g. example.com). Can be a parent domain to list all subzones."
  2. First observedv1.1.0

TDQS

A4.4/5.0
Behavior4/5

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

There are no annotations, so the description carries the burden of disclosing behavior. It explains the subtle distinction that omitting the domain returns records across all matching zones including subzones, while specifying a domain returns only that exact domain. This adds valuable transparency beyond simple parameter descriptions.

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 highly concise, consisting of two sentences that front-load the core purpose and then add necessary filtering details. Every sentence earns its place 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 tool with only two parameters and no output schema, the description provides sufficient context about the tool's behavior. It could mention the return format or pagination, but for a straightforward list operation, the current description is adequate and complete.

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?

Schema coverage is 100%, so parameters are already described. The description adds extra semantics by clarifying that zone can match subzones and how the domain filter applies, which is not fully captured in the schema descriptions.

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 lists DNS records in a zone, with an optional filter by domain. It uses a specific verb ('List') and resource ('DNS records'), and distinguishes itself from sibling tools like dns_list_zones by focusing on records within zones.

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 clear context on when to use the tool with or without the domain parameter, explaining the behavior for both cases. However, it does not explicitly mention when not to use it or name alternative tools for different tasks.

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