task_get
Retrieve a single task's complete details including subtasks, notes, comments, and dependencies to stay informed on project progress.
Instructions
Get a single task with full details including all subtasks, related notes, comments, and dependencies.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Task ID |
Implementation Reference
- src/tools/tasks.ts:295-345 (handler)The handler function that executes the task_get tool logic. Fetches a single task by ID from the database, including its subtasks, notes, comments, dependencies, and dependents.
function handleTaskGet(args: Record<string, unknown>) { const db = getDb(); const id = args.id as number; const task = db .prepare( `SELECT t.*, e.name as epic_name FROM tasks t JOIN epics e ON e.id = t.epic_id WHERE t.id = ?` ) .get(id); if (!task) throw new Error(`Task ${id} not found`); const subtasks = db .prepare('SELECT * FROM subtasks WHERE task_id = ? ORDER BY sort_order, created_at') .all(id); const notes = db .prepare( `SELECT * FROM notes WHERE related_entity_type = 'task' AND related_entity_id = ? ORDER BY created_at DESC` ) .all(id); const comments = db .prepare('SELECT * FROM comments WHERE task_id = ? ORDER BY created_at ASC') .all(id); // Dependencies: what this task depends on const dependsOn = db .prepare( `SELECT t.id, t.title, t.status FROM task_dependencies d JOIN tasks t ON t.id = d.depends_on_task_id WHERE d.task_id = ?` ) .all(id); // Dependents: what tasks depend on this task const dependents = db .prepare( `SELECT t.id, t.title, t.status FROM task_dependencies d JOIN tasks t ON t.id = d.task_id WHERE d.depends_on_task_id = ?` ) .all(id); return { ...(task as object), subtasks, notes, comments, depends_on: dependsOn, dependents }; } - src/tools/tasks.ts:78-89 (schema)The tool definition/schema for task_get, declaring the tool name, description, and input validation schema (requires an integer 'id').
{ name: 'task_get', description: 'Get a single task with full details including all subtasks, related notes, comments, and dependencies.', annotations: { title: 'Get Task', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { id: { type: 'integer', description: 'Task ID' }, }, required: ['id'], }, }, - src/tools/tasks.ts:416-421 (registration)The handlers map that registers handleTaskGet under the key 'task_get'. This is exported and merged into the global ALL_HANDLERS in index.ts.
export const handlers: Record<string, ToolHandler> = { task_create: handleTaskCreate, task_list: handleTaskList, task_get: handleTaskGet, task_update: handleTaskUpdate, }; - src/index.ts:37-49 (registration)The central handler registry (ALL_HANDLERS) that merges all tool handlers including taskHandlers (which contains task_get). The CallToolRequestSchema handler dispatches to the correct function by name.
const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = { ...projectHandlers, ...epicHandlers, ...taskHandlers, ...subtaskHandlers, ...noteHandlers, ...commentHandlers, ...templateHandlers, ...dashboardHandlers, ...searchHandlers, ...activityHandlers, ...exportImportHandlers, };