Skip to main content
Glama

dynadot_nameserver

Manage custom nameserver (glue record) configurations for domains: register new nameservers, update IP addresses, delete existing records, or list all registered nameservers.

Instructions

Manage registered nameservers (glue records): register, update IP, delete, list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform: list: List all registered nameservers | register: Register a custom nameserver | add: Add a nameserver | set_ip: Update nameserver IP | delete: Delete a nameserver | delete_by_domain: Delete all nameservers for a domain
hostNoNameserver hostname
ipNoIP address
domainNoDomain name (e.g., example.com)

Implementation Reference

  • Defines the CompositeTool for 'dynadot_nameserver', including all actions (list, register, add, set_ip, delete, delete_by_domain), their Dynadot API commands, input schemas, and descriptions.
    {
      name: 'dynadot_nameserver',
      description: 'Manage registered nameservers (glue records): register, update IP, delete, list',
      actions: {
        list: {
          command: 'server_list',
          description: 'List all registered nameservers',
        },
        register: {
          command: 'register_ns',
          description: 'Register a custom nameserver',
          params: z.object({ host: p.host, ip: p.ip }),
        },
        add: {
          command: 'add_ns',
          description: 'Add a nameserver',
          params: z.object({ host: p.host }),
        },
        set_ip: {
          command: 'set_ns_ip',
          description: 'Update nameserver IP',
          params: z.object({ host: p.host, ip: p.ip }),
        },
        delete: {
          command: 'delete_ns',
          description: 'Delete a nameserver',
          params: z.object({ host: p.host }),
        },
        delete_by_domain: {
          command: 'delete_ns_by_domain',
          description: 'Delete all nameservers for a domain',
          params: z.object({ domain: p.domain }),
        },
      },
    },
  • src/register.ts:36-36 (registration)
    Registers the 'dynadot_nameserver' tool (via loop over compositeTools) with MCP server, dynamically building inputSchema from actions and providing a generic handler that dispatches to the appropriate Dynadot API command based on the 'action' parameter.
    server.registerTool(
  • The registerAllTools function iterates over all composite tools including 'dynadot_nameserver', constructs dynamic input schemas and registers each with a shared handler pattern that executes Dynadot API calls.
    export function registerAllTools(server: McpServer): void {
      for (const tool of compositeTools) {
        // Build action enum from keys
        const actionKeys = Object.keys(tool.actions) as [string, ...string[]];
    
        // Build combined input schema with action + all possible params
        const actionDescriptions = actionKeys
          .map((k) => {
            const actionDef = tool.actions[k];
            return actionDef ? `${k}: ${actionDef.description}` : k;
          })
          .join(' | ');
    
        const inputSchema: Record<string, z.ZodTypeAny> = {
          action: z.enum(actionKeys).describe(`Action to perform: ${actionDescriptions}`),
        };
    
        // Collect all unique params across actions
        for (const action of Object.values(tool.actions)) {
          if (action?.params) {
            const shape = action.params.shape;
            for (const [key, schema] of Object.entries(shape)) {
              if (!inputSchema[key]) {
                // Make optional since not all actions need all params
                inputSchema[key] = (schema as z.ZodTypeAny).optional();
              }
            }
          }
        }
    
        server.registerTool(
          tool.name,
          {
            description: tool.description,
            inputSchema,
          },
          async (input) => {
            const action = input.action as string;
            const actionDef = tool.actions[action];
    
            if (!actionDef) {
              throw new Error(`Unknown action: ${action}. Valid actions: ${actionKeys.join(', ')}`);
            }
    
            const client = getClient();
            const params = actionDef.transform
              ? actionDef.transform(action, input as Record<string, unknown>)
              : (input as ApiParams);
    
            // Remove 'action' from params sent to API
            delete params.action;
    
            const result = await client.execute(actionDef.command, params);
            return {
              content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
            };
          }
        );
      }
    }

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/joachimBrindeau/domain-mcp'

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