template_delete
Delete a task template using its ID. Cleans up project template lists by removing outdated or incorrect templates.
Instructions
Delete a task template.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Template ID |
Implementation Reference
- src/tools/templates.ts:64-75 (schema)Schema definition for template_delete tool with input requiring 'id' (integer)
{ 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:159-171 (handler)Handler function that deletes a task template by ID 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:173-178 (registration)Registration of template_delete mapped to handleTemplateDelete in the exported handlers map
export const handlers: Record<string, ToolHandler> = { template_create: handleTemplateCreate, template_list: handleTemplateList, template_apply: handleTemplateApply, template_delete: handleTemplateDelete, };