Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

by jhirono

delete-task

Remove a task and its subtasks from a Microsoft Todo list using the task ID and list ID.

Instructions

Delete a task from a Microsoft Todo list. This will remove the task and all its checklist items (subtasks).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the task list
taskIdYesID of the task to delete

Implementation Reference

  • The handler function for the 'delete-task' tool. It authenticates with Microsoft Graph API using getAccessToken, constructs the DELETE URL for the specific task, calls makeGraphRequest to delete it, and returns a success or error message.
    async ({ listId, taskId }) => {
      try {
        const token = await getAccessToken();
        if (!token) {
          return {
            content: [
              {
                type: "text",
                text: "Failed to authenticate with Microsoft API",
              },
            ],
          };
        }
    
        // Make a DELETE request to the Microsoft Graph API
        const url = `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}`;
        console.error(`Deleting task: ${url}`);
        
        // The DELETE method doesn't return a response body, so we expect null
        await makeGraphRequest<null>(
          url,
          token,
          "DELETE"
        );
        
        // If we get here, the delete was successful (204 No Content)
        return {
          content: [
            {
              type: "text",
              text: `Task with ID: ${taskId} was successfully deleted from list: ${listId}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error deleting task: ${error}`,
            },
          ],
        };
      }
    }
  • Zod input schema defining the required parameters: listId (string) and taskId (string).
    {
      listId: z.string().describe("ID of the task list"),
      taskId: z.string().describe("ID of the task to delete")
    },
  • Registration of the 'delete-task' tool using server.tool, including name, description, schema, and inline handler function.
    server.tool(
      "delete-task",
      "Delete a task from a Microsoft Todo list. This will remove the task and all its checklist items (subtasks).",
      {
        listId: z.string().describe("ID of the task list"),
        taskId: z.string().describe("ID of the task to delete")
      },
      async ({ listId, taskId }) => {
        try {
          const token = await getAccessToken();
          if (!token) {
            return {
              content: [
                {
                  type: "text",
                  text: "Failed to authenticate with Microsoft API",
                },
              ],
            };
          }
    
          // Make a DELETE request to the Microsoft Graph API
          const url = `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}`;
          console.error(`Deleting task: ${url}`);
          
          // The DELETE method doesn't return a response body, so we expect null
          await makeGraphRequest<null>(
            url,
            token,
            "DELETE"
          );
          
          // If we get here, the delete was successful (204 No Content)
          return {
            content: [
              {
                type: "text",
                text: `Task with ID: ${taskId} was successfully deleted from list: ${listId}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error deleting task: ${error}`,
              },
            ],
          };
        }
      }
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses a key behavioral trait: the task and all its checklist items (subtasks) will be removed. However, it does not mention irreversibility, required permissions, or failure behavior, leaving some uncertainty about side effects.

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 two sentences, directly states the action, and includes the important nuance about subtasks in the second sentence. There is no redundant or unnecessary information.

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

Completeness4/5

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

Given the tool's simplicity (two parameters, no output schema), the description covers the essential behavior and side effects. It could mention permanence or prerequisites, but the current level is adequate for a straightforward delete operation.

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?

The input schema describes both required parameters (listId and taskId) with their purposes, achieving 100% coverage. The tool description adds no additional parameter-specific semantics, so it relies on the schema, which is already sufficient.

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

Purpose5/5

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

The description uses the specific verb 'Delete' and identifies the resource as 'a task from a Microsoft Todo list,' making it clear what action is performed. It also mentions the cascading removal of checklist items, which distinguishes it from sibling tools like delete-task-list and delete-checklist-item.

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

Usage Guidelines4/5

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

The description clearly indicates this tool is for deleting individual tasks within a Todo list, providing context that implies the appropriate use case. It does not explicitly contrast with sibling delete operations or state when not to use it, but the resource scope is unambiguous enough to guide selection.

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