Skip to main content
Glama

delete_task

Remove a task from the orchestration server when it has no dependent tasks, ensuring clean task management and coordination.

Instructions

Delete a task if it has no dependents

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesID of the task to delete

Implementation Reference

  • The handler for the 'delete_task' tool. It extracts the task_id from arguments, checks if the task exists and has no dependent tasks, deletes the task from the tasks object, saves the changes to the JSON file, and returns a confirmation message.
    case "delete_task": {
      const { task_id } = request.params.arguments as {
        task_id: string;
      };
    
      debug(`Deleting task ${task_id}`);
    
      const task = tasks[task_id];
      if (!task) {
        throw new McpError(ErrorCode.InvalidRequest, `Task ${task_id} not found`);
      }
    
      // Check if any other tasks depend on this one
      const dependentTasks = Object.values(tasks).filter(t => 
        t.dependencies?.includes(task_id)
      );
    
      if (dependentTasks.length > 0) {
        throw new McpError(
          ErrorCode.InvalidRequest, 
          `Cannot delete task ${task_id} as it has dependent tasks: ${dependentTasks.map(t => t.id).join(', ')}`
        );
      }
    
      delete tasks[task_id];
      saveTasks();
      debug(`Deleted task ${task_id}`);
    
      return {
        content: [{
          type: "text",
          text: JSON.stringify({ deleted: task_id }, null, 2)
        }]
      };
    }
  • src/index.ts:388-401 (registration)
    Registration of the 'delete_task' tool in the ListToolsRequestSchema handler, providing the tool's name, description, and input schema for discovery by MCP clients.
    {
      name: "delete_task",
      description: "Delete a task if it has no dependents",
      inputSchema: {
        type: "object",
        properties: {
          task_id: {
            type: "string",
            description: "ID of the task to delete"
          }
        },
        required: ["task_id"]
      }
    },
  • The input schema for the 'delete_task' tool, defining the required 'task_id' parameter.
    inputSchema: {
      type: "object",
      properties: {
        task_id: {
          type: "string",
          description: "ID of the task to delete"
        }
      },
      required: ["task_id"]
    }
Behavior2/5

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

With no annotations provided, the description carries full burden. It discloses the dependency check behavior, which is valuable. However, it lacks details on permissions needed, whether deletion is reversible, error handling for invalid IDs, or confirmation prompts. For a destructive operation with zero annotation coverage, this is insufficient.

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 a single, efficient sentence that front-loads the key action and condition. Every word earns its place with no redundancy or fluff, making it easy to parse quickly.

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

Completeness2/5

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

Given this is a destructive mutation tool with no annotations and no output schema, the description is incomplete. It covers the dependency condition but misses critical context like permissions, reversibility, error responses, or what happens post-deletion. For its complexity level, more behavioral disclosure is needed.

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% for the single parameter 'task_id', so the schema already documents it adequately. The description doesn't add parameter-specific details beyond implying task_id usage, but with 0 parameters needing extra semantics (only one well-covered param), baseline 4 is appropriate as no compensation is needed.

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 action ('Delete') and resource ('a task'), specifying the condition ('if it has no dependents'). It distinguishes from siblings like 'complete_task' or 'update_task' by focusing on removal rather than modification. However, it doesn't explicitly contrast with all siblings like 'get_task_status'.

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 context for when to use this tool ('if it has no dependents'), implying it should not be used when tasks have dependencies. It doesn't explicitly name alternatives or state when-not scenarios beyond the dependency condition, but the conditional guidance is strong.

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/mokafari/orchestrator-server'

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