delete-tasklist
Remove a task list from Google Tasks by specifying its ID, helping users manage their task organization by eliminating unwanted lists.
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:409-447 (handler)Handler function for 'delete-tasklist' tool: authenticates user, calls Google Tasks API to delete the specified tasklist, returns success or error message.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 the 'tasklist' parameter as a required string.{ tasklist: z.string().describe("Task list ID to delete"), },
- src/index.ts:403-448 (registration)MCP server registration of the 'delete-tasklist' tool including name, description, schema, and inline handler.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}`, }, ], }; } } );