delete-task
Remove a specific task from a Google Tasks list by providing the task and task list IDs. Simplifies task management through the Google Tasks MCP Server integration.
Instructions
Delete a task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | Task ID to delete | |
| tasklist | Yes | Task list ID |
Implementation Reference
- src/index.ts:747-786 (handler)The handler function for the 'delete-task' tool. It checks authentication, calls tasks.tasks.delete API with tasklist and task IDs, and returns success or error response.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 input schema defining parameters: tasklist (string) and task (string).{ tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID to delete"), },
- src/index.ts:740-787 (registration)MCP server.tool registration for 'delete-task' tool, including name, description, schema, and inline handler.server.tool( "delete-task", "Delete a task", { tasklist: z.string().describe("Task list ID"), task: z.string().describe("Task ID to delete"), }, 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}`, }, ], }; } } );