delete-checklist-item
Remove a specific subtask from a task in Microsoft Todo by providing the task list ID, task ID, and checklist item ID to delete.
Instructions
Delete a checklist item (subtask) from a task. This removes just the specific subtask, not the parent task.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| checklistItemId | Yes | ID of the checklist item to delete | |
| listId | Yes | ID of the task list | |
| taskId | Yes | ID of the task |
Implementation Reference
- src/todo-index.ts:1377-1421 (handler)Handler function that authenticates using getAccessToken, constructs the Microsoft Graph API DELETE endpoint for the specified checklist item, executes the DELETE request via makeGraphRequest, and returns success or error message.async ({ listId, taskId, checklistItemId }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Make a DELETE request to the Microsoft Graph API const url = `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems/${checklistItemId}`; console.error(`Deleting checklist item: ${url}`); // The DELETE method doesn't return a response body, so we expect null await makeGraphRequest<null>( url, token, "DELETE" ); // If we get here, the delete was successful (204 No Content) return { content: [ { type: "text", text: `Checklist item with ID: ${checklistItemId} was successfully deleted from task: ${taskId}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error deleting checklist item: ${error}`, }, ], }; } }
- src/todo-index.ts:1373-1376 (schema)Zod input schema defining the required parameters: listId, taskId, and checklistItemId for the delete-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 delete") },
- src/todo-index.ts:1369-1422 (registration)MCP server tool registration call for 'delete-checklist-item', including name, description, input schema, and handler function.server.tool( "delete-checklist-item", "Delete a checklist item (subtask) from a task. This removes just the specific subtask, not the parent task.", { 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 delete") }, async ({ listId, taskId, checklistItemId }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Make a DELETE request to the Microsoft Graph API const url = `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems/${checklistItemId}`; console.error(`Deleting checklist item: ${url}`); // The DELETE method doesn't return a response body, so we expect null await makeGraphRequest<null>( url, token, "DELETE" ); // If we get here, the delete was successful (204 No Content) return { content: [ { type: "text", text: `Checklist item with ID: ${checklistItemId} was successfully deleted from task: ${taskId}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error deleting checklist item: ${error}`, }, ], }; } } );