Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

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}`,
              },
            ],
          };
        }
      }
    );
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the destructive behavior ('remove the task and all its checklist items'), which is crucial for a deletion operation. However, it doesn't mention permissions required, whether deletion is reversible, rate limits, or what happens if the task doesn't exist. The description adds some behavioral context but leaves significant gaps for a destructive tool.

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 concise sentences that efficiently convey the core action and important side effect. Every word earns its place - the first sentence states the primary purpose, the second clarifies the scope of deletion. No wasted words or unnecessary elaboration.

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

Completeness3/5

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

For a destructive tool with no annotations and no output schema, the description provides basic purpose and scope but lacks important context. It doesn't explain what happens on success/failure, whether there's confirmation required, or what permissions are needed. The description is minimally adequate but leaves the agent with significant unknowns about the tool's behavior and outcomes.

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%, so the schema already documents both parameters (listId and taskId) with clear descriptions. The description doesn't add any parameter-specific information beyond what's in the schema. This meets the baseline of 3 when schema coverage is high, but doesn't provide additional semantic context.

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 clearly states the specific action ('Delete'), target resource ('a task from a Microsoft Todo list'), and scope ('remove the task and all its checklist items'). It distinguishes from siblings like delete-checklist-item (which only removes subtasks) and delete-task-list (which removes entire lists).

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

Usage Guidelines3/5

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

The description implies usage when needing to permanently remove a task and its subtasks, but doesn't explicitly state when to use this vs. alternatives like archiving or when not to use it (e.g., for temporary removal). It mentions the effect on checklist items, which helps differentiate from delete-checklist-item, but lacks explicit guidance on prerequisites or comparisons to other deletion tools.

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

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/jhirono/todoMCP'

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