project_list
List and filter projects with epic/task counts and completion percentages to track progress in a structured database.
Instructions
List all projects with epic/task counts and completion percentages. Optionally filter by status.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| status | No | Filter by status |
Implementation Reference
- src/tools/projects.ts:86-112 (handler)Handler function for the project_list tool.
function handleProjectList(args: Record<string, unknown>) { const db = getDb(); const status = args.status as string | undefined; let sql = ` SELECT p.*, COUNT(DISTINCT e.id) as epic_count, COUNT(DISTINCT t.id) as task_count, SUM(CASE WHEN t.status = 'done' THEN 1 ELSE 0 END) as done_count, CASE WHEN COUNT(DISTINCT t.id) > 0 THEN ROUND(SUM(CASE WHEN t.status = 'done' THEN 1 ELSE 0 END) * 100.0 / COUNT(DISTINCT t.id), 1) ELSE 0 END as completion_pct FROM projects p LEFT JOIN epics e ON e.project_id = p.id LEFT JOIN tasks t ON t.epic_id = e.id `; const params: unknown[] = []; if (status) { sql += ' WHERE p.status = ?'; params.push(status); } sql += ' GROUP BY p.id ORDER BY p.created_at DESC'; return db.prepare(sql).all(...params); } - src/tools/projects.ts:32-47 (schema)Definition and input schema for the project_list tool.
{ name: 'project_list', description: 'List all projects with epic/task counts and completion percentages. Optionally filter by status.', annotations: { title: 'List Projects', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { status: { type: 'string', enum: ['active', 'on_hold', 'completed', 'archived'], description: 'Filter by status', }, }, }, }, - src/tools/projects.ts:130-132 (registration)Registration of the project_list handler.
export const handlers: Record<string, ToolHandler> = { project_create: handleProjectCreate, project_list: handleProjectList,