Skip to main content
Glama

subtask_delete

Remove subtasks from project tracking by specifying IDs. Use this tool to delete single or multiple subtasks in Saga MCP's structured database.

Instructions

Delete one or more subtasks. Accepts a single ID or array of IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idsYes

Implementation Reference

  • The implementation of the subtask_delete tool handler.
    function handleSubtaskDelete(args: Record<string, unknown>) {
      const db = getDb();
      const rawIds = args.ids;
      const ids = Array.isArray(rawIds) ? rawIds as number[] : [rawIds as number];
    
      const getStmt = db.prepare('SELECT * FROM subtasks WHERE id = ?');
      const delStmt = db.prepare('DELETE FROM subtasks WHERE id = ?');
    
      const deleted = db.transaction(() => {
        return ids.map((id) => {
          const row = getStmt.get(id) as Record<string, unknown> | undefined;
          if (!row) throw new Error(`Subtask ${id} not found`);
          delStmt.run(id);
          logActivity(db, 'subtask', id, 'deleted', null, null, null, `Subtask '${row.title}' deleted`);
          return { id, title: row.title, deleted: true };
        });
      })();
    
      return deleted.length === 1 ? deleted[0] : deleted;
    }
  • The schema definition for the subtask_delete tool.
      name: 'subtask_delete',
      description: 'Delete one or more subtasks. Accepts a single ID or array of IDs.',
      annotations: { title: 'Delete Subtask(s)', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false },
      inputSchema: {
        type: 'object',
        properties: {
          ids: {
            oneOf: [
              { type: 'integer', description: 'Single subtask ID' },
              { type: 'array', items: { type: 'integer' }, description: 'Multiple subtask IDs' },
            ],
          },
        },
        required: ['ids'],
      },
    },
  • Tool handler registration for subtask_delete.
    export const handlers: Record<string, ToolHandler> = {
      subtask_create: handleSubtaskCreate,
      subtask_update: handleSubtaskUpdate,
      subtask_delete: handleSubtaskDelete,

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/spranab/saga-mcp'

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