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;
    }
Behavior4/5

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

Despite no annotations, the description discloses key behavioral traits: it returns records across all zones matching the zone name when no domain is specified, and for exact domain when specified. It also mentions subzone inclusion. This provides sufficient transparency for a read-only list operation, though it could elaborate on response format or pagination.

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 the main purpose front-loaded. Every sentence adds value: the first states the core action, the second explains the filtering behavior. No wasted words, appropriately sized.

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?

While the description covers behavior adequately for a simple list tool, it does not describe the output format or fields returned. Since there is no output schema, this information would be helpful for context completeness. The tool's complexity is low, so the gap is moderate.

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?

Both 'zone' and 'domain' have descriptions in the input schema (100% coverage). The tool description adds context beyond the schema by explaining how omitting vs. specifying 'domain' affects the result set, including subzone behavior. This adds meaningful guidance for parameter usage.

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 action ('list'), resource ('DNS records'), and scope ('in a zone'). It distinguishes itself from siblings by specifying it returns records within zones, not the zones themselves. The optional filtering by domain further clarifies its purpose.

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 explicit guidance on when to use the domain parameter versus omitting it, explaining that omitting returns all records across matching zones (including subzones) and specifying filters to exact domain. This helps the agent decide which parameter combination to use. However, it does not explicitly mention when not to use this tool versus alternatives like dns_resolve.

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/rosschurchill/technitium-mcp-secure'

If you have feedback or need assistance with the MCP directory API, please join our Discord server