Skip to main content
Glama

google_tasks_delete_task

Removes a specific task from a Google Tasks list by providing its task ID. Optionally, specify the task list ID for targeted deletion within Google MCP server.

Instructions

Delete a task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesID of the task to delete
taskListIdNoID of the task list the task belongs to (uses default if not specified)

Implementation Reference

  • The main handler function that validates the input arguments and invokes the GoogleTasks instance to delete the specified task.
    export async function handleTasksDeleteTask(
      args: any,
      googleTasksInstance: GoogleTasks
    ) {
      if (!isDeleteTaskArgs(args)) {
        throw new Error("Invalid arguments for google_tasks_delete_task");
      }
      const { taskId, taskListId } = args;
      const result = await googleTasksInstance.deleteTask(taskId, taskListId);
      return {
        content: [{ type: "text", text: result }],
        isError: false,
      };
    }
  • The tool's schema definition, including input schema for parameters taskId (required) and optional taskListId.
    export const DELETE_TASK_TOOL: Tool = {
      name: "google_tasks_delete_task",
      description: "Delete a task",
      inputSchema: {
        type: "object",
        properties: {
          taskId: {
            type: "string",
            description: "ID of the task to delete",
          },
          taskListId: {
            type: "string",
            description:
              "ID of the task list the task belongs to (uses default if not specified)",
          },
        },
        required: ["taskId"],
      },
    };
  • Registration in the server request handler's switch statement that dispatches calls to this tool to the appropriate handler function.
    case "google_tasks_delete_task":
      return await tasksHandlers.handleTasksDeleteTask(
        args,
        googleTasksInstance
      );
  • Core helper method in the GoogleTasks class that calls the Google Tasks API to delete the task.
    async deleteTask(taskId: string, taskListId?: string) {
      try {
        const targetTaskList = taskListId || this.defaultTaskList;
    
        await this.tasks.tasks.delete({
          tasklist: targetTaskList,
          task: taskId,
        });
    
        return `Task ${taskId} deleted from task list ${targetTaskList}.`;
      } catch (error) {
        throw new Error(
          `Failed to delete task: ${
            error instanceof Error ? error.message : String(error)
          }`
        );
      }
    }
  • Type guard (schema validator) used in the handler to validate input arguments match the expected types.
    export function isDeleteTaskArgs(args: any): args is {
      taskId: string;
      taskListId?: string;
    } {
      return (
        args &&
        typeof args.taskId === "string" &&
        (args.taskListId === undefined || typeof args.taskListId === "string")
      );
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states 'Delete a task' which implies a destructive mutation, but doesn't disclose critical behavioral traits: whether deletion is permanent or reversible, authentication requirements, rate limits, error conditions, or what happens to subtasks. This leaves significant gaps for safe agent operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with zero wasted words—a single verb-noun phrase that front-loads the core action. Every word earns its place, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive mutation with 2 parameters) and lack of annotations or output schema, the description is incomplete. It doesn't cover behavioral aspects, error handling, or output expectations, leaving the agent with insufficient context to use the tool safely and effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with clear parameter descriptions in the schema. The tool description adds no additional parameter semantics beyond the schema, such as format examples or constraints. Since the schema fully documents the parameters, the baseline score of 3 is appropriate, but no extra value is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Delete') and the resource ('a task'), making the purpose immediately understandable. It distinguishes from siblings like 'google_tasks_delete_tasklist' by specifying the resource type. However, it doesn't specify the scope (e.g., from Google Tasks API) or differentiate from non-sibling deletions like 'google_calendar_delete_event'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing task ID), when not to use it (e.g., for archiving vs. deletion), or direct alternatives like 'google_tasks_complete_task' for marking tasks as done without deletion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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

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