Skip to main content
Glama
108yen

task-orchestrator-mcp

by 108yen

deleteTask

Remove a task from the task orchestrator by specifying its unique ID to manage task lists and maintain organization.

Instructions

Delete a task by its ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTask ID

Implementation Reference

  • Core handler function that implements the deleteTask logic: validates the task ID, locates the task in the hierarchy, ensures no child tasks exist, removes the task from its parent or root array, persists the change to storage, and returns the deleted task ID.
    export function deleteTask(id: string): { id: string } {
      if (!id || typeof id !== "string") {
        throw new Error("Task ID is required and must be a string")
      }
    
      const tasks = readTasks()
      const taskToDelete = findTaskById(tasks, id)
    
      if (!taskToDelete) {
        throw new Error(`Task with id '${id}' not found`)
      }
    
      // Check if task has child tasks
      if (taskToDelete.tasks.length > 0) {
        throw new Error(
          `Cannot delete task '${id}' because it has child tasks. Please delete all child tasks first.`,
        )
      }
    
      // Find and remove task from parent's tasks array or root level
      const parentTask = findParentTask(tasks, id)
    
      if (parentTask) {
        // Remove from parent's tasks array
        const index = parentTask.tasks.findIndex((t) => t.id === id)
        if (index !== -1) {
          parentTask.tasks.splice(index, 1)
        }
      } else {
        // Remove from root level
        const index = tasks.findIndex((t) => t.id === id)
        if (index !== -1) {
          tasks.splice(index, 1)
        }
      }
    
      writeTasks(tasks)
    
      return { id }
    }
  • src/tools.ts:277-318 (registration)
    Registration of the 'deleteTask' MCP tool, including input schema validation (task ID), description, and a thin wrapper handler that invokes the core deleteTask function, formats the response, and handles errors with standardized error format.
    server.registerTool(
      "deleteTask",
      {
        description: "Delete a task by its ID",
        inputSchema: {
          id: z.string().describe("Task ID"),
        },
      },
      (args) => {
        try {
          const result = deleteTask(args.id)
          return {
            content: [
              {
                text: JSON.stringify(result, null, 2),
                type: "text",
              },
            ],
          }
        } catch (error) {
          return {
            content: [
              {
                text: JSON.stringify(
                  {
                    error: {
                      code: "TASK_DELETE_ERROR",
                      message:
                        error instanceof Error ? error.message : "Unknown error",
                    },
                  },
                  null,
                  2,
                ),
                type: "text",
              },
            ],
            isError: true,
          }
        }
      },
    )
  • Zod input schema for deleteTask tool: requires a string 'id' parameter representing the Task ID.
    inputSchema: {
      id: z.string().describe("Task ID"),
    },
Behavior2/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. While 'Delete' implies a destructive mutation, the description doesn't specify whether deletion is permanent, reversible, requires specific permissions, or has side effects (e.g., cascading deletions). For a destructive operation with zero annotation coverage, this is a significant gap in transparency.

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, direct sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable. Every word earns its place, achieving optimal conciseness for a simple tool.

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?

For a destructive mutation tool with no annotations and no output schema, the description is incomplete. It lacks critical context: behavioral traits (permanence, permissions), usage guidelines versus siblings, and expected outcomes. The high schema coverage doesn't compensate for these gaps, making it inadequate for safe and effective agent use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with the single parameter 'id' documented as 'Task ID'. The description adds no additional semantic context beyond what the schema provides (e.g., format examples, validation rules, or where to find the ID). Baseline 3 is appropriate when the schema does the heavy lifting, but no extra value is added.

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 by its ID'), making the purpose immediately understandable. It distinguishes from siblings like 'completeTask' or 'updateTask' by specifying deletion. However, it doesn't explicitly mention what 'task' refers to in the system context, which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'completeTask' or 'updateTask'. There's no mention of prerequisites (e.g., task must exist), consequences (e.g., permanent deletion), or when deletion is appropriate versus other operations. This leaves the agent with insufficient context for optimal tool selection.

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/108yen/task-orchestrator-mcp'

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