delete_task
Permanently removes a task from a Microsoft To Do list using list ID and task ID.
Instructions
Delete a task permanently.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | ||
| task_id | Yes |
Implementation Reference
- src/graph.ts:444-448 (handler)The core handler function that executes the delete_task logic. Sends a DELETE HTTP request to the Microsoft Graph API endpoint /me/todo/lists/{listId}/tasks/{taskId}.
export async function deleteTask(listId: string, taskId: string): Promise<void> { await graphFetch<void>(`/me/todo/lists/${enc(listId)}/tasks/${enc(taskId)}`, { method: "DELETE", }); } - src/index.ts:192-195 (schema)Zod schema for runtime validation of the delete_task tool's input arguments. Defines required string fields: list_id and task_id.
delete_task: z.object({ list_id: z.string(), task_id: z.string(), }), - src/index.ts:591-602 (registration)MCP tool registration metadata for the 'delete_task' tool. Includes description ('Delete a task permanently.') and inputSchema defining list_id (string) and task_id (string) as required parameters.
{ name: "delete_task", description: "Delete a task permanently.", inputSchema: { type: "object", properties: { list_id: { type: "string" }, task_id: { type: "string" }, }, required: ["list_id", "task_id"], }, }, - src/index.ts:1034-1038 (registration)Call-site implementation in the main tool dispatch switch-case. Parses arguments using the Zod schema, calls the deleteTask handler, and returns a localized success message via i18n.
case "delete_task": { const a = schemas.delete_task.strict().parse(args); await deleteTask(a.list_id, a.task_id); return text(t.taskDeleted(a.task_id)); } - src/i18n.ts:83-84 (helper)Localized message helper (English) that produces the success response 'Task {id} deleted.' after a task is deleted.
taskDeleted: (id) => `Task ${id} deleted.`, subItemDeleted: (id) => `Sub-item ${id} deleted.`,