delete-tasklist
Remove a task list by specifying its ID, effectively managing and organizing tasks within the Google Tasks MCP Server. Simplifies task list cleanup and maintenance.
Instructions
Delete a task list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tasklist | Yes | Task list ID to delete |
Implementation Reference
- src/index.ts:403-448 (registration)Registration of the 'delete-tasklist' tool using server.tool, including inline handler and schema.server.tool( "delete-tasklist", "Delete a task list", { tasklist: z.string().describe("Task list ID to delete"), }, async ({ tasklist }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { await tasks.tasklists.delete({ tasklist, }); return { content: [ { type: "text", text: `Task list with ID '${tasklist}' was successfully deleted.`, }, ], }; } catch (error) { console.error("Error deleting task list:", error); return { isError: true, content: [ { type: "text", text: `Error deleting task list: ${error}`, }, ], }; } } );
- src/index.ts:409-447 (handler)Inline anonymous async handler function that performs authentication check, calls tasks.tasklists.delete, and returns success/error response.async ({ tasklist }) => { if (!isAuthenticated()) { return { isError: true, content: [ { type: "text", text: "Not authenticated. Please use the 'authenticate' tool first.", }, ], }; } try { await tasks.tasklists.delete({ tasklist, }); return { content: [ { type: "text", text: `Task list with ID '${tasklist}' was successfully deleted.`, }, ], }; } catch (error) { console.error("Error deleting task list:", error); return { isError: true, content: [ { type: "text", text: `Error deleting task list: ${error}`, }, ], }; } }
- src/index.ts:406-408 (schema)Zod input schema defining 'tasklist' as a required string parameter.{ tasklist: z.string().describe("Task list ID to delete"), },