Skip to main content
Glama

deleteTask

Destructive

Delete a task from Teamwork by providing its task ID. Removes the specified task permanently.

Instructions

Delete a task from Teamwork

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesThe ID of the task to delete

Implementation Reference

  • Tool handler that receives input, validates taskId, calls teamworkService.deleteTask(), and returns the result in MCP content format.
    export async function handleDeleteTask(input: any) {
      logger.info('Calling teamworkService.deleteTask()');
      logger.info(`Task ID: ${input?.taskId}`);
      
      try {
        const taskId = String(input?.taskId);
        if (!taskId) {
          throw new Error("Task ID is required");
        }
        
        const result = await teamworkService.deleteTask(taskId);
        logger.info(`Task deleted successfully for task ID: ${taskId}`);
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({ success: result }, null, 2)
          }]
        };
      } catch (error: any) {
        return createErrorResponse(error, 'Deleting task');
      }
    } 
  • Tool definition/schema with name 'deleteTask', description, inputSchema (taskId as integer, required), and annotations marking it destructive.
    // Tool definition
    export const deleteTaskDefinition = {
      name: "deleteTask",
      description: "Delete a task from Teamwork",
      inputSchema: {
        type: "object",
        properties: {
          taskId: {
            type: "integer",
            description: "The ID of the task to delete"
          }
        },
        required: ["taskId"]
      },
      annotations: {
        title: "Delete a Task",
        readOnlyHint: false,
        destructiveHint: true,
        openWorldHint: false
      }
    };
  • Registration of deleteTask in the tools index: maps definition and handler.
    { definition: deleteTask, handler: handleDeleteTask },
  • Service layer function that actually performs the HTTP DELETE request to Teamwork API at /tasks/{taskId}.json.
    import logger from '../../utils/logger.js';
    import { ensureApiClient } from '../core/apiClient.js';
    
    /**
     * Deletes a task from Teamwork
     * @param taskId The ID of the task to delete
     * @returns True if the task was successfully deleted
     */
    export const deleteTask = async (taskId: string) => {
      try {
        const api = ensureApiClient();
        await api.delete(`/tasks/${taskId}.json`);
        return true;
      } catch (error: any) {
        logger.error(`Error deleting task ${taskId}: ${error.message}`);
        throw new Error(`Failed to delete task ${taskId}`);
      }
    };
    
    export default deleteTask; 
Behavior2/5

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

The description adds no behavioral context beyond the annotation destructiveHint: true. It does not clarify whether the deletion is permanent or any side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single direct sentence, concise and front-loaded. It is not verbose but could include more context without losing conciseness.

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

Completeness3/5

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

For a simple destructive tool with one parameter, the description is minimally adequate. It lacks detail on operation result or confirmation, but the annotations partially compensate.

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 coverage is 100% with parameter description 'The ID of the task to delete'. The tool description adds no extra meaning beyond the 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?

The description explicitly states 'Delete a task from Teamwork', providing a specific verb and resource. It clearly distinguishes from sibling tools like createTask or updateTask.

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?

No guidance on when to use this tool or when not to. It does not mention alternatives or prerequisites, relying solely on the name and description.

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/Vizioz/Teamwork-MCP'

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