template_list
Retrieve available task templates to standardize project tracking and maintain consistency across work items in the Saga MCP server.
Instructions
List all available task templates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/templates.ts:103-111 (handler)The handler function that executes the template_list tool logic by querying the database for all templates and calculating task counts.
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-44 (schema)The tool definition for template_list including name, description, and input schema.
{ 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)The registration object mapping the tool name 'template_list' to its handler function 'handleTemplateList'.
export const handlers: Record<string, ToolHandler> = { template_create: handleTemplateCreate, template_list: handleTemplateList, template_apply: handleTemplateApply, template_delete: handleTemplateDelete, };