google_tasks_delete_tasklist
Automate the deletion of task lists in Google Tasks using the task list ID to streamline task management and maintain organization.
Instructions
Delete a task list
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskListId | Yes | ID of the task list to delete |
Implementation Reference
- handlers/tasks.ts:158-171 (handler)The main handler function that validates input arguments using isDeleteTaskListArgs and delegates to the GoogleTasks instance's deleteTaskList method to perform the deletion.export async function handleTasksDeleteTasklist( args: any, googleTasksInstance: GoogleTasks ) { if (!isDeleteTaskListArgs(args)) { throw new Error("Invalid arguments for google_tasks_delete_tasklist"); } const { taskListId } = args; const result = await googleTasksInstance.deleteTaskList(taskListId); return { content: [{ type: "text", text: result }], isError: false, }; }
- utils/tasks.ts:237-251 (helper)The core implementation in the GoogleTasks class that calls the Google Tasks API to delete the specified task list.async deleteTaskList(taskListId: string) { try { await this.tasks.tasklists.delete({ tasklist: taskListId, }); return `Task list ${taskListId} deleted.`; } catch (error) { throw new Error( `Failed to delete task list: ${ error instanceof Error ? error.message : String(error) }` ); } }
- tools/tasks/index.ts:186-199 (schema)The tool definition including name, description, and input schema for validation.export const DELETE_TASKLIST_TOOL: Tool = { name: "google_tasks_delete_tasklist", description: "Delete a task list", inputSchema: { type: "object", properties: { taskListId: { type: "string", description: "ID of the task list to delete", }, }, required: ["taskListId"], }, };
- server-setup.ts:258-262 (registration)The switch case in the main server request handler that routes calls to this tool to its handler function.case "google_tasks_delete_tasklist": return await tasksHandlers.handleTasksDeleteTasklist( args, googleTasksInstance );
- utils/helper.ts:412-416 (schema)Type guard function used in the handler to validate input arguments matching the tool schema.export function isDeleteTaskListArgs(args: any): args is { taskListId: string; } { return args && typeof args.taskListId === "string"; }