Skip to main content
Glama
mstfe

Google Tasks MCP Server

by mstfe

delete_task

Remove a task from your Google Tasks default list by specifying its ID to manage and organize your tasks effectively.

Instructions

Delete a task from the default task list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesID of the task to delete

Implementation Reference

  • Handler for the 'delete_task' tool. Validates arguments (using create_task validator, note potential bug), extracts taskId, calls Google Tasks API to delete the task, returns success message or throws error.
    if (request.params.name === "delete_task") {
      if (!isValidCreateTaskArgs(request.params.arguments)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid arguments for creating a task. 'title' must be a string, and 'notes' must be a string or undefined."
        );
      }
      const args = request.params.arguments;
      const taskId  = args.taskId;
      if (!taskId) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "The 'taskId' field is required."
        );
      }
      try {
        await tasks.tasks.delete({
          tasklist: "@default",
          task: taskId,
        });
    
        return {
          content: [
            {
              type: "text",
              text: "Task deleted successfully.",
            },
          ],
        };
      } catch (error) {
        throw new McpError(
          ErrorCode.InternalError,
          `Tasks API error: ${error}`
        );
      }
    }
  • src/index.ts:162-172 (registration)
    Registration of the 'delete_task' tool in the ListTools response, including name, description, and input schema.
    {
      name: "delete_task",
      description: "Delete a task from the default task list",
      inputSchema: {
        type: "object",
        properties: {
          taskId: { type: "string", description: "ID of the task to delete" },
        },
        required: ["taskId"],
      },
    },

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/mstfe/mcp-google-tasks'

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