Skip to main content
Glama

set_nameservers

Configure nameservers for a domain by providing a list of up to 13 hostnames.

Instructions

Set nameservers for a domain. Accepts up to 13 nameserver hostnames.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesDomain name to configure
nameserversYesList of nameserver hostnames (e.g., ['ns1.example.com', 'ns2.example.com'])

Implementation Reference

  • MCP tool handler for 'set_nameservers'. Defines the tool with Zod schema for domain (string) and nameservers (array of strings, 1-13). The handler calls client.setNameservers(domain, nameservers) and returns the JSON result or an error message.
    // ─── set_nameservers ──────────────────────────────────────────
    
    server.tool(
      "set_nameservers",
      "Set nameservers for a domain. Accepts up to 13 nameserver hostnames.",
      {
        domain: z.string().describe("Domain name to configure"),
        nameservers: z
          .array(z.string())
          .min(1)
          .max(13)
          .describe("List of nameserver hostnames (e.g., ['ns1.example.com', 'ns2.example.com'])"),
      },
      async ({ domain, nameservers }) => {
        try {
          const result = await client.setNameservers(domain, nameservers);
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(result, null, 2) },
            ],
          };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return {
            content: [
              { type: "text" as const, text: `Failed to set nameservers: ${msg}` },
            ],
            isError: true,
          };
        }
      }
    );
  • Zod input schema for the set_nameservers tool: 'domain' (required string) and 'nameservers' (required array of strings, min 1, max 13).
    server.tool(
      "set_nameservers",
      "Set nameservers for a domain. Accepts up to 13 nameserver hostnames.",
      {
        domain: z.string().describe("Domain name to configure"),
        nameservers: z
          .array(z.string())
          .min(1)
          .max(13)
          .describe("List of nameserver hostnames (e.g., ['ns1.example.com', 'ns2.example.com'])"),
      },
  • The tool is registered on the McpServer instance via server.tool('set_nameservers', ...) inside the registerDnsTools function in src/tools/dns.ts. The registration is called from src/index.ts line 51.
    server.tool(
      "set_nameservers",
      "Set nameservers for a domain. Accepts up to 13 nameserver hostnames.",
      {
        domain: z.string().describe("Domain name to configure"),
        nameservers: z
          .array(z.string())
          .min(1)
          .max(13)
          .describe("List of nameserver hostnames (e.g., ['ns1.example.com', 'ns2.example.com'])"),
      },
      async ({ domain, nameservers }) => {
        try {
          const result = await client.setNameservers(domain, nameservers);
          return {
            content: [
              { type: "text" as const, text: JSON.stringify(result, null, 2) },
            ],
          };
        } catch (error) {
          const msg = error instanceof Error ? error.message : String(error);
          return {
            content: [
              { type: "text" as const, text: `Failed to set nameservers: ${msg}` },
            ],
            isError: true,
          };
        }
      }
    );
  • Helper method in DynadotClient that executes the API call. setNameservers() maps the nameservers array to ns0, ns1, ... parameters and calls the Dynadot API with 'set_ns' command.
    async setNameservers(domain: string, nameservers: string[]): Promise<DynadotResponse> {
      const params: Record<string, string> = { domain };
      nameservers.forEach((ns, i) => {
        params[`ns${i}`] = ns;
      });
      return this.call("set_ns", params);
    }
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It does not specify whether the operation replaces existing nameservers or appends, nor does it mention authentication requirements or potential side effects. The term 'Set' is ambiguous.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise with two sentences and no wasted words. It is front-loaded with the core purpose. However, some might argue it is too terse at the expense of missing important details.

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?

Given the tool is simple with 2 parameters and no output schema, the description partially covers what is needed. But it lacks information on return format, error handling, or how it interacts with sibling tools like 'add_nameserver'.

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% with descriptions for both parameters. The description adds no additional meaning beyond the schema; it merely restates the nameserver limit already defined in maxItems.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool sets nameservers for a domain, using the verb 'Set' and resource 'domain'. It also mentions the limit of 13 hostnames, which adds specificity. However, it does not differentiate from sibling 'add_nameserver', which may also add nameservers.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives like 'add_nameserver' or 'get_nameservers'. There is no mention of prerequisites, context, or exclusion criteria.

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/mikusnuz/dynadot-mcp'

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