template_list
Retrieve all available task templates to standardize and streamline task creation across projects.
Instructions
List all available task templates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/templates.ts:103-111 (handler)Handler function for template_list tool. Queries all templates from the database, parses template_data JSON, and returns each template with its task_count.
function handleTemplateList() { const db = getDb(); const templates = db.prepare('SELECT * FROM templates ORDER BY created_at DESC').all() as Array<Record<string, unknown>>; return templates.map((t) => ({ ...t, task_count: (JSON.parse(t.template_data as string) as unknown[]).length, })); } - src/tools/templates.ts:36-43 (schema)Tool definition/schema for template_list. Declares name 'template_list', description 'List all available task templates.', and an empty inputSchema (no parameters required).
{ name: 'template_list', description: 'List all available task templates.', annotations: { title: 'List Templates', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: {}, }, - src/tools/templates.ts:173-178 (registration)Exported handlers mapping. Maps 'template_list' to handleTemplateList function.
export const handlers: Record<string, ToolHandler> = { template_create: handleTemplateCreate, template_list: handleTemplateList, template_apply: handleTemplateApply, template_delete: handleTemplateDelete, }; - src/index.ts:37-49 (registration)Top-level handlers aggregation. The templateHandlers (including template_list) are spread into ALL_HANDLERS, which is used by the CallTool request handler.
const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = { ...projectHandlers, ...epicHandlers, ...taskHandlers, ...subtaskHandlers, ...noteHandlers, ...commentHandlers, ...templateHandlers, ...dashboardHandlers, ...searchHandlers, ...activityHandlers, ...exportImportHandlers, };