Skip to main content
Glama
rosschurchill

Technitium MCP Secure

dns_export_zone

Export a DNS zone file in standard BIND format for backup or transfer. Returns zone contents as text.

Instructions

Export a DNS zone file in standard BIND format. Returns the zone file as text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
zoneYesZone domain name to export

Implementation Reference

  • Handler function for dns_export_zone tool. Validates the zone domain, calls the Technitium DNS API /api/zones/export endpoint to get the BIND zone file, and returns the result as JSON.
    handler: async (args) => {
      const zone = validateDomain(args.zone as string);
      const text = await client.callRawTextGet("/api/zones/export", { zone });
      return JSON.stringify({ zone, zoneFile: text }, null, 2);
    },
  • Schema/definition for dns_export_zone tool. Defines the tool name, description, and input schema requiring a 'zone' string parameter (the domain name to export).
    {
      definition: {
        name: "dns_export_zone",
        description:
          "Export a DNS zone file in standard BIND format. Returns the zone file as text.",
        inputSchema: {
          type: "object",
          properties: {
            zone: {
              type: "string",
              description: "Zone domain name to export",
            },
          },
          required: ["zone"],
        },
      },
  • Registration of dns_export_zone as a tool entry inside the zoneTools() function, which is exported and included via getAllTools() in src/tools/index.ts.
      {
        definition: {
          name: "dns_export_zone",
          description:
            "Export a DNS zone file in standard BIND format. Returns the zone file as text.",
          inputSchema: {
            type: "object",
            properties: {
              zone: {
                type: "string",
                description: "Zone domain name to export",
              },
            },
            required: ["zone"],
          },
        },
        readonly: true,
        handler: async (args) => {
          const zone = validateDomain(args.zone as string);
          const text = await client.callRawTextGet("/api/zones/export", { zone });
          return JSON.stringify({ zone, zoneFile: text }, null, 2);
        },
      },
    ];
  • validateDomain helper function used in the handler to normalize and validate the zone domain name.
    export function validateDomain(domain: string): string {
      if (!domain || typeof domain !== "string") {
        throw new Error("Domain name is required");
      }
      const trimmed = domain.trim().toLowerCase();
      if (trimmed.length > 253) {
        throw new Error("Domain name exceeds maximum length of 253 characters");
      }
      if (!DOMAIN_RE.test(trimmed)) {
        throw new Error("Invalid domain name format");
      }
      return trimmed;
    }
  • callRawTextGet method on TechnitiumClient used to make the GET request to the /api/zones/export endpoint and return raw text (the BIND zone file).
    async callRawTextGet(
      endpoint: string,
      params: Record<string, string> = {}
    ): Promise<string> {
      await this.ensureAuth();
    
      const qs = new URLSearchParams({
        ...params,
        token: this.sessionToken!,
      });
    
      const resp = await fetch(`${this.config.url}${endpoint}?${qs.toString()}`, {
        method: "GET",
      });
    
      const text = await resp.text();
    
      try {
        const json = JSON.parse(text) as TechnitiumResponse;
        if (json.status === "invalid-token") {
          this.sessionToken = null;
          audit.logAuth("token_expired", false);
          await this.ensureAuth();
          const retryQs = new URLSearchParams({
            ...params,
            token: this.sessionToken!,
          });
          const retryResp = await fetch(
            `${this.config.url}${endpoint}?${retryQs.toString()}`,
            { method: "GET" }
          );
          return retryResp.text();
        }
        if (json.status !== "ok") {
          throw new Error(json.errorMessage || `API error: ${json.status}`);
        }
      } catch (e) {
        if (e instanceof SyntaxError) {
          return text;
        }
        throw e;
      }
    
      return text;
    }
Behavior2/5

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

No annotations provided, so description must cover behavioral traits. It does not state whether this is read-only, destructive, or requires authentication. Minimal disclosure beyond basic purpose.

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?

Single sentence, front-loaded with the action, no wasted words. Efficient and clear.

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?

Adequate for a simple tool with one parameter and no output schema. Minor gaps: no mention of file size, encoding, or any limitations. Could briefly note that the zone must exist.

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%; the parameter 'zone' is described as 'Zone domain name to export'. The description adds no additional meaning beyond the schema, so baseline score of 3 applies.

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?

Clearly states the action (export), resource (DNS zone file), format (standard BIND), and output (text). Distinguishes from sibling tools like dns_list_zones which list but do not export.

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

Usage Guidelines3/5

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

Implied usage: export an existing zone. No explicit guidance on when to use vs alternatives (e.g., dns_list_zones for listing), no prerequisites stated.

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