get_task_detail
Retrieve comprehensive task details by ID, including implementation guides and verification criteria, to ensure accurate execution and planning.
Instructions
Get the complete detailed information of a task based on its ID, including unabridged implementation guides and verification criteria, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | Task ID to view details |
Implementation Reference
- src/tools/taskTools.ts:1142-1197 (handler)The core handler function for the 'get_task_detail' tool. It fetches the task details using searchTasksWithCommand (which supports memory areas), generates a formatted prompt with getTaskDetailPrompt, and handles errors.export async function getTaskDetail({ taskId, }: z.infer<typeof getTaskDetailSchema>) { try { // Use searchTasksWithCommand instead of getTaskById to implement memory area task search // Set isId to true to search by ID; page number is 1, page size is 1 const result = await searchTasksWithCommand(taskId, true, 1, 1); // Check if the task is found if (result.tasks.length === 0) { return { content: [ { type: "text" as const, text: `## Error\n\nTask with ID \`${taskId}\` not found. Please confirm if the task ID is correct.`, }, ], isError: true, }; } // Get the found task (the first and only one) const task = result.tasks[0]; // Use prompt generator to get the final prompt const prompt = getTaskDetailPrompt({ taskId, task, }); return { content: [ { type: "text" as const, text: prompt, }, ], }; } catch (error) { // Use prompt generator to get error message const errorPrompt = getTaskDetailPrompt({ taskId, error: error instanceof Error ? error.message : String(error), }); return { content: [ { type: "text" as const, text: errorPrompt, }, ], isError: true, }; } }
- src/tools/taskTools.ts:1132-1139 (schema)Zod schema defining the input for getTaskDetail: requires a non-empty taskId string.export const getTaskDetailSchema = z.object({ taskId: z .string() .min(1, { message: "Task ID cannot be empty, please provide a valid task ID", }) .describe("Task ID to view details"), });
- src/index.ts:312-317 (registration)Tool registration in the MCP server's ListToolsRequest handler, specifying name, description from MD template, and JSON schema from Zod.name: "get_task_detail", description: loadPromptFromTemplate( "toolsDescription/getTaskDetail.md" ), inputSchema: zodToJsonSchema(getTaskDetailSchema), },
- src/index.ts:540-550 (handler)Dispatch handler in the MCP server's CallToolRequest handler: validates input with schema and calls the getTaskDetail function.case "get_task_detail": parsedArgs = await getTaskDetailSchema.safeParseAsync( request.params.arguments ); if (!parsedArgs.success) { throw new Error( `Invalid arguments for tool ${request.params.name}: ${parsedArgs.error.message}` ); } result = await getTaskDetail(parsedArgs.data); return result;