get-checklist-items
Retrieve subtasks and smaller components for a specific Microsoft Todo task to track progress and manage detailed steps.
Instructions
Get checklist items (subtasks) for a specific task. Checklist items are smaller steps or components that belong to a parent task.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listId | Yes | ID of the task list | |
| taskId | Yes | ID of the task |
Implementation Reference
- src/todo-index.ts:1116-1206 (registration)Registration of the 'get-checklist-items' MCP tool, including name, description, input schema, and inline handler function that fetches checklist items via Microsoft Graph API.server.tool( "get-checklist-items", "Get checklist items (subtasks) for a specific task. Checklist items are smaller steps or components that belong to a parent task.", { listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), }, async ({ listId, taskId }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Fetch the task first to get its title const taskResponse = await makeGraphRequest<Task>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}`, token ); const taskTitle = taskResponse ? taskResponse.title : "Unknown Task"; // Fetch the checklist items const response = await makeGraphRequest<{ value: ChecklistItem[] }>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems`, token ); if (!response) { return { content: [ { type: "text", text: `Failed to retrieve checklist items for task: ${taskId}`, }, ], }; } const items = response.value || []; if (items.length === 0) { return { content: [ { type: "text", text: `No checklist items found for task "${taskTitle}" (ID: ${taskId})`, }, ], }; } const formattedItems = items.map((item) => { const status = item.isChecked ? "✓" : "○"; let itemInfo = `${status} ${item.displayName} (ID: ${item.id})`; // Add creation date if available if (item.createdDateTime) { const createdDate = new Date(item.createdDateTime).toLocaleString(); itemInfo += `\nCreated: ${createdDate}`; } return itemInfo; }); return { content: [ { type: "text", text: `Checklist items for task "${taskTitle}" (ID: ${taskId}):\n\n${formattedItems.join("\n\n")}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error fetching checklist items: ${error}`, }, ], }; } } );
- src/todo-index.ts:1123-1205 (handler)Handler function that authenticates, fetches the parent task title, retrieves checklist items from Microsoft Graph API endpoint `/me/todo/lists/{listId}/tasks/{taskId}/checklistItems`, formats them with check status and creation date, and returns formatted text response.async ({ listId, taskId }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Fetch the task first to get its title const taskResponse = await makeGraphRequest<Task>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}`, token ); const taskTitle = taskResponse ? taskResponse.title : "Unknown Task"; // Fetch the checklist items const response = await makeGraphRequest<{ value: ChecklistItem[] }>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems`, token ); if (!response) { return { content: [ { type: "text", text: `Failed to retrieve checklist items for task: ${taskId}`, }, ], }; } const items = response.value || []; if (items.length === 0) { return { content: [ { type: "text", text: `No checklist items found for task "${taskTitle}" (ID: ${taskId})`, }, ], }; } const formattedItems = items.map((item) => { const status = item.isChecked ? "✓" : "○"; let itemInfo = `${status} ${item.displayName} (ID: ${item.id})`; // Add creation date if available if (item.createdDateTime) { const createdDate = new Date(item.createdDateTime).toLocaleString(); itemInfo += `\nCreated: ${createdDate}`; } return itemInfo; }); return { content: [ { type: "text", text: `Checklist items for task "${taskTitle}" (ID: ${taskId}):\n\n${formattedItems.join("\n\n")}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error fetching checklist items: ${error}`, }, ], }; } }
- src/todo-index.ts:1119-1122 (schema)Zod input schema defining required parameters: listId (task list ID) and taskId (task ID).{ listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), },
- src/todo-index.ts:384-389 (schema)TypeScript interface defining the structure of a ChecklistItem used in the tool's response typing.interface ChecklistItem { id: string; displayName: string; isChecked: boolean; createdDateTime?: string; }