template_delete
Remove task templates from the Saga MCP project tracker to maintain a clean, organized database structure for AI agents managing projects and tasks.
Instructions
Delete a task template.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Template ID |
Implementation Reference
- src/tools/templates.ts:159-171 (handler)The handler function that executes the deletion of a template from the database.
function handleTemplateDelete(args: Record<string, unknown>) { const db = getDb(); const id = args.id as number; const template = db.prepare('SELECT * FROM templates WHERE id = ?').get(id) as Record<string, unknown> | undefined; if (!template) throw new Error(`Template ${id} not found`); db.prepare('DELETE FROM templates WHERE id = ?').run(id); logActivity(db, 'template', id, 'deleted', null, null, null, `Template '${template.name}' deleted`); return { message: `Template '${template.name}' deleted` }; } - src/tools/templates.ts:65-75 (schema)The schema definition for the template_delete tool.
name: 'template_delete', description: 'Delete a task template.', annotations: { title: 'Delete Template', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { id: { type: 'integer', description: 'Template ID' }, }, required: ['id'], }, }, - src/tools/templates.ts:177-177 (registration)Registration of the template_delete handler in the exports map.
template_delete: handleTemplateDelete,