Skip to main content
Glama

delete_task

Moves a task to trash by its dart_id; recoverable via Dart web UI.

Instructions

Delete a task (moves to trash - recoverable via Dart web UI)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dart_idYesTask dart_id (also accepts "id" or "task_id")

Implementation Reference

  • Core handler for the delete_task tool. Validates input, resolves dart_id (accepting aliases), calls DartClient.deleteTask() API, and returns deletion confirmation with recoverability info.
    export async function handleDeleteTask(input: DeleteTaskInput): Promise<DeleteTaskOutput> {
      const DART_TOKEN = process.env.DART_TOKEN;
    
      if (!DART_TOKEN) {
        throw new DartAPIError(
          'DART_TOKEN environment variable is required. Get your token from: https://app.dartai.com/?settings=account',
          401
        );
      }
    
      // ============================================================================
      // Step 1: Validate input and dart_id
      // ============================================================================
      if (!input || typeof input !== 'object') {
        throw new ValidationError(
          'input is required and must be an object',
          'input'
        );
      }
    
      // Accept id, task_id, or taskId as aliases for dart_id
      input.dart_id = resolveDartId(input as unknown as Record<string, unknown>);
    
      // ============================================================================
      // Step 2: Call DartClient.deleteTask()
      // ============================================================================
      const client = new DartClient({ token: DART_TOKEN });
    
      let deleteResult: { success: boolean; dart_id: string };
      try {
        deleteResult = await client.deleteTask(input.dart_id);
      } catch (error) {
        // Handle 404 errors specifically
        if (error instanceof DartAPIError && error.statusCode === 404) {
          throw new DartAPIError(
            `Task not found: No task with dart_id "${input.dart_id}" exists in workspace`,
            404,
            error.response
          );
        }
        // Re-throw other errors with enhanced context
        if (error instanceof DartAPIError) {
          throw new DartAPIError(
            `Failed to delete task: ${error.message}`,
            error.statusCode,
            error.response
          );
        }
        throw error;
      }
    
      // ============================================================================
      // Step 3: Return deletion confirmation
      // ============================================================================
      return {
        dart_id: deleteResult.dart_id,
        deleted: true,
        recoverable: true,
        message: `Task "${input.dart_id}" has been moved to trash. You can restore it from the Dart web UI at https://app.dartai.com/`,
      };
    }
  • Input type definition for delete_task: requires a dart_id string.
    export interface DeleteTaskInput {
      dart_id: string;
    }
  • Output type definition for delete_task: includes dart_id, deletion status, recoverability flag, and user-facing message.
    export interface DeleteTaskOutput {
      dart_id: string;
      deleted: boolean;
      recoverable: boolean;
      message: string;
    }
  • src/index.ts:480-493 (registration)
    MCP tool registration for delete_task with name, description, and JSON Schema input validation (requires dart_id).
    {
      name: 'delete_task',
      description: 'Delete a task (moves to trash - recoverable via Dart web UI)',
      inputSchema: {
        type: 'object',
        properties: {
          dart_id: {
            type: 'string',
            description: 'Task dart_id (also accepts "id" or "task_id")',
          },
        },
        required: ['dart_id'],
      },
    },
  • src/index.ts:1040-1050 (registration)
    Request dispatch routing: the 'delete_task' case in the CallToolRequestSchema handler calls handleDeleteTask and returns the result as JSON text.
    case 'delete_task': {
      const result = await handleDeleteTask((args || {}) as any);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
Behavior4/5

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

The description reveals that deletion moves to trash and is recoverable via Dart web UI, which is valuable behavioral context beyond the schema. However, it lacks info on permissions, idempotency, or 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.

Conciseness5/5

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

The description is a single, well-structured sentence with no unnecessary words. It conveys the core action and key behavioral trait efficiently.

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 simple one-parameter tool with no output schema, the description adequately covers purpose and recoverability. However, it could mention the return value (e.g., success message or error) for complete context.

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% for the single parameter, and the description does not add additional meaning; it only restates the parameter name. Baseline score is appropriate as schema already documents the parameter.

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 clearly states 'Delete a task' with the additional detail that it moves to trash and is recoverable, which distinguishes it from batch delete or other operations.

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

Usage Guidelines3/5

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

The description implies usage for deleting a task but provides no guidance on when to use this tool versus batch_delete_tasks or alternatives, nor any prerequisites or exclusions.

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/standardbeagle/dart-query'

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