Skip to main content
Glama
windalfin

ClickUp MCP Server

by windalfin

delete_folder

Permanently remove a ClickUp folder and all its contents including lists and tasks. This irreversible action requires either the folder ID or folder name with space identifier.

Instructions

⚠️ PERMANENTLY DELETE a folder and all its contents. This action cannot be undone. Valid parameter combinations:

  1. Use folderId alone (preferred and safest)

  2. Use folderName + (spaceId or spaceName)

WARNING: This will also delete all lists and tasks within the folder.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderIdNoID of folder to delete (preferred). Use this instead of folderName for safety.
folderNameNoName of folder to delete. When using this, you MUST also provide spaceId or spaceName.
spaceIdNoID of space containing the folder (required with folderName). Use this instead of spaceName if you have it.
spaceNameNoName of space containing the folder (required with folderName). Only use if you don't have spaceId.

Implementation Reference

  • Main handler function for delete_folder tool. Resolves target folder ID from parameters (supporting folderId or folderName+space), fetches folder details for confirmation, calls folderService.deleteFolder, and returns JSON success message.
    export async function handleDeleteFolder(parameters: any) {
      const { folderId, folderName, spaceId, spaceName } = parameters;
      
      let targetFolderId = folderId;
      
      // If no folderId provided but folderName is, look up the folder ID
      if (!targetFolderId && folderName) {
        let targetSpaceId = spaceId;
        
        // If no spaceId provided but spaceName is, look up the space ID first
        if (!targetSpaceId && spaceName) {
          const spaceIdResult = await workspaceService.findSpaceByName(spaceName);
          if (!spaceIdResult) {
            throw new Error(`Space "${spaceName}" not found`);
          }
          targetSpaceId = spaceIdResult.id;
        }
        
        if (!targetSpaceId) {
          throw new Error("Either spaceId or spaceName must be provided when using folderName");
        }
        
        const folderResult = await folderService.findFolderByName(targetSpaceId, folderName);
        if (!folderResult) {
          throw new Error(`Folder "${folderName}" not found in space`);
        }
        targetFolderId = folderResult.id;
      }
      
      if (!targetFolderId) {
        throw new Error("Either folderId or folderName must be provided");
      }
    
      try {
        // Get folder details before deletion for confirmation message
        const folder = await folderService.getFolder(targetFolderId);
        const folderName = folder.name;
        
        // Delete the folder
        await folderService.deleteFolder(targetFolderId);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify(
              {
                message: `Folder "${folderName}" deleted successfully`
              },
              null,
              2
            )
          }]
        };
      } catch (error: any) {
        throw new Error(`Failed to delete folder: ${error.message}`);
      }
    } 
  • Input schema defining parameters for delete_folder tool: folderId (preferred), or folderName with spaceId/spaceName.
    inputSchema: {
      type: "object",
      properties: {
        folderId: {
          type: "string",
          description: "ID of folder to delete (preferred). Use this instead of folderName for safety."
        },
        folderName: {
          type: "string",
          description: "Name of folder to delete. When using this, you MUST also provide spaceId or spaceName."
        },
        spaceId: {
          type: "string",
          description: "ID of space containing the folder (required with folderName). Use this instead of spaceName if you have it."
        },
        spaceName: {
          type: "string",
          description: "Name of space containing the folder (required with folderName). Only use if you don't have spaceId."
        }
      },
      required: []
    }
  • Tool registration object for 'delete_folder' including name, description, and reference to inputSchema.
    export const deleteFolderTool = {
      name: "delete_folder",
      description: "⚠️ PERMANENTLY DELETE a folder and all its contents. This action cannot be undone. Valid parameter combinations:\n1. Use folderId alone (preferred and safest)\n2. Use folderName + (spaceId or spaceName)\n\nWARNING: This will also delete all lists and tasks within the folder.",
      inputSchema: {
        type: "object",
        properties: {
          folderId: {
            type: "string",
            description: "ID of folder to delete (preferred). Use this instead of folderName for safety."
          },
          folderName: {
            type: "string",
            description: "Name of folder to delete. When using this, you MUST also provide spaceId or spaceName."
          },
          spaceId: {
            type: "string",
            description: "ID of space containing the folder (required with folderName). Use this instead of spaceName if you have it."
          },
          spaceName: {
            type: "string",
            description: "Name of space containing the folder (required with folderName). Only use if you don't have spaceId."
          }
        },
        required: []
      }
    };
  • src/server.ts:67-92 (registration)
    MCP server registration: includes deleteFolderTool in the list of available tools returned by ListTools.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          workspaceHierarchyTool,
          createTaskTool,
          getTaskTool,
          getTasksTool,
          updateTaskTool,
          moveTaskTool,
          duplicateTaskTool,
          deleteTaskTool,
          createBulkTasksTool,
          updateBulkTasksTool,
          moveBulkTasksTool,
          deleteBulkTasksTool,
          createListTool,
          createListInFolderTool,
          getListTool,
          updateListTool,
          deleteListTool,
          createFolderTool,
          getFolderTool,
          updateFolderTool,
          deleteFolderTool
        ]
      };
  • FolderService.deleteFolder helper: Performs the actual ClickUp API DELETE request to /folder/{folderId}.
    async deleteFolder(folderId: string): Promise<ServiceResponse<void>> {
      try {
        this.logOperation('deleteFolder', { folderId });
        
        await this.client.delete(`/folder/${folderId}`);
        
        return {
          success: true
        };
      } catch (error) {
        throw this.handleError(error, `Failed to delete folder ${folderId}`);
      }
    }
Behavior5/5

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

With no annotations provided, the description carries full burden and excels at disclosing critical behavioral traits. It clearly warns about permanence ('cannot be undone'), scope of deletion ('all its contents', 'all lists and tasks within the folder'), and safety considerations ('preferred and safest'). This goes well beyond what a basic 'delete' operation might imply.

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 perfectly structured and front-loaded: it starts with the critical warning and main action, then provides parameter guidance, and ends with an additional warning about scope. Every sentence earns its place with essential information, and there's no wasted text.

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?

For a destructive tool with no annotations and no output schema, the description does an excellent job covering the critical aspects: permanence, scope, and parameter usage. The only minor gap is lack of explicit guidance on when to choose this tool over sibling deletion tools, but otherwise it's highly complete for its complexity level.

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 description coverage is 100%, so the baseline is 3. The description adds significant value by explaining parameter combinations and their implications: it clarifies that folderId alone is 'preferred and safest' and that folderName requires space identifiers. This provides practical guidance beyond the schema's technical documentation.

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 explicitly states the action ('PERMANENTLY DELETE') and resource ('a folder and all its contents'), making the purpose crystal clear. It distinguishes itself from sibling tools like delete_list or delete_task by specifying it deletes entire folders with their contents, not just individual items.

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 clear guidance on when to use specific parameter combinations (folderId alone vs. folderName with space identifiers), which helps the agent choose the right approach. However, it doesn't explicitly state when to use this tool versus alternatives like delete_list or delete_task for more targeted deletions.

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/windalfin/clickup-mcp-server'

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