delete-task
Remove a specific task from a Google Tasks list by providing the task list ID and task ID.
Instructions
Delete a task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasklist | Yes | Task list ID | |
| task | Yes | Task ID to delete |
Implementation Reference
- src/index.ts:747-787 (handler)The handler function for the 'delete-task' tool. It checks authentication, calls the Google Tasks API to delete the specified task, and returns success or error messages.async ({ tasklist, task }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { await tasks.tasks.delete({ tasklist, task, }); return { content: [ { type: "text", text: `Task with ID '${task}' was successfully deleted.`, }, ], }; } catch (error) { console.error("Error deleting task:", error); return { isError: true, content: [ { type: "text", text: `Error deleting task: ${error}`, }, ], }; } } );
- src/index.ts:743-746 (schema)Zod schema defining the input parameters: tasklist ID and task ID.{ tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID to delete"), },
- src/index.ts:741-742 (registration)Registration of the 'delete-task' tool using server.tool, including name and description."delete-task", "Delete a task",