update-checklist-item
Modify checklist item details in Microsoft Todo by updating text content or marking completion status to track subtask progress.
Instructions
Update an existing checklist item (subtask). Allows changing the text content or completion status of the subtask.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listId | Yes | ID of the task list | |
| taskId | Yes | ID of the task | |
| checklistItemId | Yes | ID of the checklist item to update | |
| displayName | No | New text content of the checklist item | |
| isChecked | No | Whether the item is checked off |
Implementation Reference
- src/todo-index.ts:1280-1367 (handler)Full implementation of the 'update-checklist-item' MCP tool handler. Registers the tool with server.tool(), defines input schema using Zod for parameters (listId, taskId, checklistItemId, optional displayName and isChecked), and implements the async handler that authenticates, prepares PATCH body, calls makeGraphRequest to Microsoft Graph API endpoint /me/todo/lists/{listId}/tasks/{taskId}/checklistItems/{checklistItemId}, and returns success/error messages.server.tool( "update-checklist-item", "Update an existing checklist item (subtask). Allows changing the text content or completion status of the subtask.", { listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), checklistItemId: z.string().describe("ID of the checklist item to update"), displayName: z.string().optional().describe("New text content of the checklist item"), isChecked: z.boolean().optional().describe("Whether the item is checked off") }, async ({ listId, taskId, checklistItemId, displayName, isChecked }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Prepare the update body, including only the fields that are provided const requestBody: any = {}; if (displayName !== undefined) { requestBody.displayName = displayName; } if (isChecked !== undefined) { requestBody.isChecked = isChecked; } // Make sure we have at least one property to update if (Object.keys(requestBody).length === 0) { return { content: [ { type: "text", text: "No properties provided for update. Please specify either displayName or isChecked.", }, ], }; } // Make the API request to update the checklist item const response = await makeGraphRequest<ChecklistItem>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems/${checklistItemId}`, token, "PATCH", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to update checklist item with ID: ${checklistItemId}`, }, ], }; } const statusText = response.isChecked ? "Checked" : "Not checked"; return { content: [ { type: "text", text: `Checklist item updated successfully!\nContent: ${response.displayName}\nStatus: ${statusText}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error updating checklist item: ${error}`, }, ], }; } } );
- src/todo-index.ts:1283-1289 (schema)Zod schema definition for the input parameters of the update-checklist-item tool.{ listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), checklistItemId: z.string().describe("ID of the checklist item to update"), displayName: z.string().optional().describe("New text content of the checklist item"), isChecked: z.boolean().optional().describe("Whether the item is checked off") },
- src/todo-index.ts:1280-1280 (registration)Registration of the 'update-checklist-item' tool using server.tool().server.tool(