Skip to main content
Glama
arpitbatra123

Google Tasks MCP Server

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
NameRequiredDescriptionDefault
tasklistYesTask list ID to delete

Implementation Reference

  • 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}`,
            },
          ],
        };
      }
    }
  • 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}`,
              },
            ],
          };
        }
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arpitbatra123/mcp-googletasks'

If you have feedback or need assistance with the MCP directory API, please join our Discord server