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
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes |
Implementation Reference
- src/tools/subtasks.ts:124-143 (handler)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; } - src/tools/subtasks.ts:42-57 (schema)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'], }, }, - src/tools/subtasks.ts:145-148 (registration)Tool handler registration for subtask_delete.
export const handlers: Record<string, ToolHandler> = { subtask_create: handleSubtaskCreate, subtask_update: handleSubtaskUpdate, subtask_delete: handleSubtaskDelete,