template_create
Create reusable task templates with variable placeholders to standardize workflows in project management systems.
Instructions
Create a reusable task template. Templates define a set of tasks that can be instantiated into any epic. Use {variable} placeholders for dynamic values.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Template name (must be unique) | |
| description | No | Template description | |
| tasks | Yes | Task definitions. Use {variable} for placeholders. |
Implementation Reference
- src/tools/templates.ts:84-101 (handler)The handler function `handleTemplateCreate` performs the insertion of a new template into the database.
function handleTemplateCreate(args: Record<string, unknown>) { const db = getDb(); const name = args.name as string; const description = (args.description as string) ?? null; const tasks = args.tasks as Array<Record<string, unknown>>; const templateData = JSON.stringify(tasks); const template = db .prepare('INSERT INTO templates (name, description, template_data) VALUES (?, ?, ?) RETURNING *') .get(name, description, templateData); const row = template as Record<string, unknown>; logActivity(db, 'template', row.id as number, 'created', null, null, null, `Template '${name}' created with ${tasks.length} task(s)`); return { ...row, tasks }; } - src/tools/templates.ts:7-35 (schema)Input schema definition for the `template_create` tool.
{ name: 'template_create', description: 'Create a reusable task template. Templates define a set of tasks that can be instantiated into any epic. Use {variable} placeholders for dynamic values.', annotations: { title: 'Create Template', readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false }, inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Template name (must be unique)' }, description: { type: 'string', description: 'Template description' }, tasks: { type: 'array', description: 'Task definitions. Use {variable} for placeholders.', items: { type: 'object', properties: { title: { type: 'string', description: 'Task title (supports {variable} placeholders)' }, description: { type: 'string', description: 'Task description (supports {variable} placeholders)' }, priority: { type: 'string', enum: ['low', 'medium', 'high', 'critical'], default: 'medium' }, estimated_hours: { type: 'number' }, tags: { type: 'array', items: { type: 'string' } }, }, required: ['title'], }, }, }, required: ['name', 'tasks'], }, }, - src/tools/templates.ts:173-178 (registration)Registration of the `template_create` handler in the `handlers` object.
export const handlers: Record<string, ToolHandler> = { template_create: handleTemplateCreate, template_list: handleTemplateList, template_apply: handleTemplateApply, template_delete: handleTemplateDelete, };