Skip to main content
Glama

delete_folder

Delete an empty folder by providing its folder ID. Removes a folder from your Dynadot account only if it has no domains assigned to it.

Instructions

Delete a folder. The folder must be empty (no domains assigned to it).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_idYesFolder ID to delete

Implementation Reference

  • Registers the 'delete_folder' MCP tool with the server, defining its input schema (folder_id string) and handler.
    server.tool(
      "delete_folder",
      "Delete a folder. The folder must be empty (no domains assigned to it).",
      {
        folder_id: z.string().describe("Folder ID to delete"),
      },
      async ({ folder_id }) => {
        try {
          const result = await client.deleteFolder(folder_id);
          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 delete folder: ${msg}` },
            ],
            isError: true,
          };
        }
      }
    );
    
    // ─── list_folders ─────────────────────────────────────────────
    
    server.tool(
      "list_folders",
      "List all folders in the Dynadot account.",
      {},
      async () => {
        try {
          const result = await client.listFolders();
          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 list folders: ${msg}` },
            ],
            isError: true,
          };
        }
      }
    );
    
    // ─── set_folder_settings ──────────────────────────────────────
    
    server.tool(
      "set_folder_settings",
      "Apply default settings to a folder. All domains in the folder will " +
        "inherit these settings. Supports nameservers, DNS, forwarding, " +
        "parking, stealth, and renewal options. Pass the appropriate " +
        "Dynadot API parameters for the setting type.",
      {
        folder_id: z.string().describe("Folder ID to configure"),
        setting_type: z
          .enum(["whois", "ns", "dns", "dns2", "forwarding", "stealth", "parking", "hosting", "email_forward", "renew_option", "clear"])
          .describe(
            "Type of setting to apply: 'whois' (WHOIS contacts), 'ns' (nameservers), " +
              "'dns' (basic DNS), 'dns2' (advanced DNS records), 'forwarding', 'stealth', " +
              "'parking', 'hosting', 'email_forward', 'renew_option', or 'clear' (remove settings)"
          ),
        params: z
          .record(z.string())
          .optional()
          .describe("Setting parameters as key-value pairs (varies by setting type)"),
      },
      async ({ folder_id, setting_type, params }) => {
        try {
          const command =
            setting_type === "clear"
              ? "set_clear_folder_setting"
              : `set_folder_${setting_type}`;
          const result = await client.call(command, {
            folder_id,
            ...(params || {}),
          });
          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 folder settings: ${msg}` },
            ],
            isError: true,
          };
        }
      }
    );
    
    // ─── rename_folder ────────────────────────────────────────────
    
    server.tool(
      "rename_folder",
      "Rename an existing folder.",
      {
        folder_id: z.string().describe("Folder ID to rename"),
        folder_name: z.string().describe("New name for the folder"),
      },
      async ({ folder_id, folder_name }) => {
        try {
          const result = await client.renameFolder(folder_id, folder_name);
          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 rename folder: ${msg}` },
            ],
            isError: true,
          };
        }
      }
    );
  • Handler function that calls client.deleteFolder(folder_id) and returns JSON result or error message.
      async ({ folder_id }) => {
        try {
          const result = await client.deleteFolder(folder_id);
          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 delete folder: ${msg}` },
            ],
            isError: true,
          };
        }
      }
    );
  • Zod schema defining the input parameter: folder_id (string).
    {
      folder_id: z.string().describe("Folder ID to delete"),
    },
  • Helper method on DynadotClient that calls the Dynadot API3 'delete_folder' command with the folder_id parameter.
    async deleteFolder(folderId: string): Promise<DynadotResponse> {
      return this.call("delete_folder", { folder_id: folderId });
    }
  • src/index.ts:55-57 (registration)
    Registration call in main entry point that wires up all folder tools including delete_folder.
    registerFolderTools(server, client);
    registerAccountTools(server, client);
    registerMarketplaceTools(server, client);
Behavior3/5

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

Discloses the emptiness precondition, a key behavioral constraint. No mention of permanence, auth, or side effects. Adequate but not rich.

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?

Two sentences, zero waste. Action and condition stated upfront.

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?

Simple tool with one parameter; description covers operation and constraint. No output schema needed. Well-suited to complexity.

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 covers folder_id with description; description adds precondition about emptiness, which is critical context beyond schema.

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?

Clear verb and resource: 'Delete a folder'. Specifies precondition (folder must be empty), distinguishing it from other folder actions like rename or list.

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?

Explicit precondition (must be empty) provides clear context; does not explicitly state when to use vs alternatives but enough for a destructive action.

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