Skip to main content
Glama
windalfin

ClickUp MCP Server

by windalfin

delete_task

Permanently delete tasks in ClickUp workspaces using task ID or name with list context. This action cannot be undone.

Instructions

⚠️ PERMANENTLY DELETE a task. This action cannot be undone. Valid parameter combinations:

  1. Use taskId alone (preferred and safest)

  2. Use taskName + optional listName (use with caution)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdNoID of task to delete (preferred). Use this instead of taskName for safety.
taskNameNoName of task to delete. Use with extreme caution as names may not be unique.
listNameNoName of list containing the task. Helps ensure correct task deletion when using taskName.

Implementation Reference

  • Main handler function for 'delete_task' tool. Resolves taskId from name if provided, fetches task details, calls service deleteTask, returns JSON confirmation.
    export async function handleDeleteTask(parameters: any) {
      const { taskId, taskName, listName } = parameters;
      
      let targetTaskId = taskId;
      
      // If no taskId but taskName is provided, look up the task ID
      if (!targetTaskId && taskName) {
        let listId: string | undefined;
        
        // If listName is provided, find the list ID first
        if (listName) {
          const hierarchy = await workspaceService.getWorkspaceHierarchy();
          const listInfo = workspaceService.findIDByNameInHierarchy(hierarchy, listName, 'list');
          
          if (!listInfo) {
            throw new Error(`List "${listName}" not found`);
          }
          listId = listInfo.id;
        }
        
        // Now find the task
        const tasks = await taskService.getTasks(listId || '');
        const foundTask = tasks.find(t => t.name.toLowerCase() === taskName.toLowerCase());
        
        if (!foundTask) {
          throw new Error(`Task "${taskName}" not found${listName ? ` in list "${listName}"` : ""}`);
        }
        targetTaskId = foundTask.id;
      }
      
      if (!targetTaskId) {
        throw new Error("Either taskId or taskName must be provided");
      }
    
      // Get task info before deleting (for the response)
      let taskInfo;
      try {
        taskInfo = await taskService.getTask(targetTaskId);
      } catch (error) {
        // If we can't get the task info, we'll continue with deletion anyway
        console.error("Error fetching task before deletion:", error);
      }
    
      // Delete the task
      await taskService.deleteTask(targetTaskId);
    
      // Format response
      return {
        content: [{
          type: "text",
          text: JSON.stringify({
            id: targetTaskId,
            name: taskInfo?.name || "Unknown",
            deleted: true,
            list: taskInfo?.list?.name || "Unknown",
            space: taskInfo?.space?.name || "Unknown"
          }, null, 2)
        }]
      };
    }
  • Tool object definition with input schema for 'delete_task', specifying parameters taskId, taskName, listName.
    export const deleteTaskTool = {
      name: "delete_task",
      description: "\u26a0\ufe0f PERMANENTLY DELETE a task. This action cannot be undone. Valid parameter combinations:\n1. Use taskId alone (preferred and safest)\n2. Use taskName + optional listName (use with caution)",
      inputSchema: {
        type: "object",
        properties: {
          taskId: {
            type: "string",
            description: "ID of task to delete (preferred). Use this instead of taskName for safety."
          },
          taskName: {
            type: "string",
            description: "Name of task to delete. Use with extreme caution as names may not be unique."
          },
          listName: {
            type: "string",
            description: "Name of list containing the task. Helps ensure correct task deletion when using taskName."
          }
        }
      }
    };
  • src/server.ts:114-115 (registration)
    Server switch statement registration: routes 'delete_task' tool calls to handleDeleteTask handler.
    case "delete_task":
      return handleDeleteTask(params);
  • src/server.ts:77-77 (registration)
    Includes deleteTaskTool in the list of available tools returned by ListToolsRequestHandler.
    deleteTaskTool,
  • TaskService.deleteTask method: performs the actual ClickUp API DELETE request to /task/{taskId}.
    async deleteTask(taskId: string): Promise<ServiceResponse<void>> {
      this.logOperation('deleteTask', { taskId });
      
      try {
        await this.makeRequest(async () => {
          await this.client.delete(`/task/${taskId}`);
        });
        
        return {
          success: true
        };
      } catch (error) {
        throw this.handleError(error, `Failed to delete task ${taskId}`);
      }
    }
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It excels by clearly stating the tool is destructive ('PERMANENTLY DELETE'), irreversible ('cannot be undone'), and includes safety warnings ('preferred and safest', 'use with caution', 'use with extreme caution'). This covers critical behavioral traits like permanence and risk without relying on annotations.

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 highly efficient and front-loaded: it starts with a critical warning icon and key action, followed by clear parameter guidelines in a bullet-like format. Every sentence earns its place by conveying essential safety information and usage rules without redundancy, making it easy to scan and understand quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive operation with 3 parameters), no annotations, and no output schema, the description is remarkably complete. It covers purpose, behavioral risks, parameter usage, and safety guidelines, leaving no critical gaps. For a deletion tool, this level of detail is sufficient to guide safe invocation without needing output schema explanations.

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 prioritizes 'taskId alone' as safest and warns about 'taskName' uniqueness issues, which goes beyond the schema's basic descriptions. However, it doesn't detail format constraints or edge cases, keeping it from a perfect score.

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 task'), making the purpose crystal clear. It distinguishes itself from sibling tools like 'delete_bulk_tasks' by specifying single-task deletion and from 'update_task' or 'duplicate_task' by emphasizing permanence. The use of '⚠️' and 'cannot be undone' reinforces the specific destructive nature.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool vs. alternatives through parameter combinations: it recommends 'taskId alone (preferred and safest)' and cautions about using 'taskName + optional listName (use with caution)'. This directly addresses when to choose specific parameter sets for safety, distinguishing it from bulk deletion tools like 'delete_bulk_tasks' by focusing on single-task operations.

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