Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

by jhirono

update-task

Modify existing Microsoft Todo tasks by updating properties like title, due date, importance, status, or categories to keep task information current and accurate.

Instructions

Update an existing task in Microsoft Todo. Allows changing any properties of the task including title, due date, importance, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the task list
taskIdYesID of the task to update
titleNoNew title of the task
bodyNoNew description or body content of the task
dueDateTimeNoNew due date in ISO format (e.g., 2023-12-31T23:59:59Z)
startDateTimeNoNew start date in ISO format (e.g., 2023-12-31T23:59:59Z)
importanceNoNew task importance
isReminderOnNoWhether to enable reminder for this task
reminderDateTimeNoNew reminder date and time in ISO format
statusNoNew status of the task
categoriesNoNew categories associated with the task

Implementation Reference

  • The handler function that executes the update-task tool logic: authenticates, constructs the update body from parameters, makes a PATCH request to Microsoft Graph API /me/todo/lists/{listId}/tasks/{taskId}, and returns success/error messages.
    async ({ listId, taskId, title, body, dueDateTime, startDateTime, importance, isReminderOn, reminderDateTime, status, categories }) => {
      try {
        const token = await getAccessToken();
        if (!token) {
          return {
            content: [
              {
                type: "text",
                text: "Failed to authenticate with Microsoft API",
              },
            ],
          };
        }
    
        // Construct the task update body with all provided properties
        const taskBody: any = {};
        
        // Add optional properties if provided
        if (title !== undefined) {
          taskBody.title = title;
        }
        
        if (body !== undefined) {
          taskBody.body = {
            content: body,
            contentType: "text"
          };
        }
        
        if (dueDateTime !== undefined) {
          if (dueDateTime === "") {
            // Remove the due date by setting it to null
            taskBody.dueDateTime = null;
          } else {
            taskBody.dueDateTime = {
              dateTime: dueDateTime,
              timeZone: "UTC",
            };
          }
        }
        
        if (startDateTime !== undefined) {
          if (startDateTime === "") {
            // Remove the start date by setting it to null
            taskBody.startDateTime = null;
          } else {
            taskBody.startDateTime = {
              dateTime: startDateTime,
              timeZone: "UTC",
            };
          }
        }
        
        if (importance !== undefined) {
          taskBody.importance = importance;
        }
        
        if (isReminderOn !== undefined) {
          taskBody.isReminderOn = isReminderOn;
        }
        
        if (reminderDateTime !== undefined) {
          if (reminderDateTime === "") {
            // Remove the reminder date by setting it to null
            taskBody.reminderDateTime = null;
          } else {
            taskBody.reminderDateTime = {
              dateTime: reminderDateTime,
              timeZone: "UTC",
            };
          }
        }
        
        if (status !== undefined) {
          taskBody.status = status;
        }
        
        if (categories !== undefined) {
          taskBody.categories = categories;
        }
        
        // Make sure we have at least one property to update
        if (Object.keys(taskBody).length === 0) {
          return {
            content: [
              {
                type: "text",
                text: "No properties provided for update. Please specify at least one property to change.",
              },
            ],
          };
        }
    
        const response = await makeGraphRequest<Task>(
          `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}`,
          token,
          "PATCH",
          taskBody
        );
        
        if (!response) {
          return {
            content: [
              {
                type: "text",
                text: `Failed to update task with ID: ${taskId} in list: ${listId}`,
              },
            ],
          };
        }
    
        return {
          content: [
            {
              type: "text",
              text: `Task updated successfully!\nID: ${response.id}\nTitle: ${response.title}`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error updating task: ${error}`,
            },
          ],
        };
      }
    }
  • Zod schema defining the input parameters for the update-task tool, including required listId and taskId, and optional fields for updating task properties.
    {
      listId: z.string().describe("ID of the task list"),
      taskId: z.string().describe("ID of the task to update"),
      title: z.string().optional().describe("New title of the task"),
      body: z.string().optional().describe("New description or body content of the task"),
      dueDateTime: z.string().optional().describe("New due date in ISO format (e.g., 2023-12-31T23:59:59Z)"),
      startDateTime: z.string().optional().describe("New start date in ISO format (e.g., 2023-12-31T23:59:59Z)"),
      importance: z.enum(["low", "normal", "high"]).optional().describe("New task importance"),
      isReminderOn: z.boolean().optional().describe("Whether to enable reminder for this task"),
      reminderDateTime: z.string().optional().describe("New reminder date and time in ISO format"),
      status: z.enum(["notStarted", "inProgress", "completed", "waitingOnOthers", "deferred"]).optional().describe("New status of the task"),
      categories: z.array(z.string()).optional().describe("New categories associated with the task")
    },
  • The server.tool registration call that registers the 'update-task' tool with name, description, input schema, and handler function on the MCP server.
    server.tool(
      "update-task",
      "Update an existing task in Microsoft Todo. Allows changing any properties of the task including title, due date, importance, etc.",
      {
        listId: z.string().describe("ID of the task list"),
        taskId: z.string().describe("ID of the task to update"),
        title: z.string().optional().describe("New title of the task"),
        body: z.string().optional().describe("New description or body content of the task"),
        dueDateTime: z.string().optional().describe("New due date in ISO format (e.g., 2023-12-31T23:59:59Z)"),
        startDateTime: z.string().optional().describe("New start date in ISO format (e.g., 2023-12-31T23:59:59Z)"),
        importance: z.enum(["low", "normal", "high"]).optional().describe("New task importance"),
        isReminderOn: z.boolean().optional().describe("Whether to enable reminder for this task"),
        reminderDateTime: z.string().optional().describe("New reminder date and time in ISO format"),
        status: z.enum(["notStarted", "inProgress", "completed", "waitingOnOthers", "deferred"]).optional().describe("New status of the task"),
        categories: z.array(z.string()).optional().describe("New categories associated with the task")
      },
      async ({ listId, taskId, title, body, dueDateTime, startDateTime, importance, isReminderOn, reminderDateTime, status, categories }) => {
        try {
          const token = await getAccessToken();
          if (!token) {
            return {
              content: [
                {
                  type: "text",
                  text: "Failed to authenticate with Microsoft API",
                },
              ],
            };
          }
    
          // Construct the task update body with all provided properties
          const taskBody: any = {};
          
          // Add optional properties if provided
          if (title !== undefined) {
            taskBody.title = title;
          }
          
          if (body !== undefined) {
            taskBody.body = {
              content: body,
              contentType: "text"
            };
          }
          
          if (dueDateTime !== undefined) {
            if (dueDateTime === "") {
              // Remove the due date by setting it to null
              taskBody.dueDateTime = null;
            } else {
              taskBody.dueDateTime = {
                dateTime: dueDateTime,
                timeZone: "UTC",
              };
            }
          }
          
          if (startDateTime !== undefined) {
            if (startDateTime === "") {
              // Remove the start date by setting it to null
              taskBody.startDateTime = null;
            } else {
              taskBody.startDateTime = {
                dateTime: startDateTime,
                timeZone: "UTC",
              };
            }
          }
          
          if (importance !== undefined) {
            taskBody.importance = importance;
          }
          
          if (isReminderOn !== undefined) {
            taskBody.isReminderOn = isReminderOn;
          }
          
          if (reminderDateTime !== undefined) {
            if (reminderDateTime === "") {
              // Remove the reminder date by setting it to null
              taskBody.reminderDateTime = null;
            } else {
              taskBody.reminderDateTime = {
                dateTime: reminderDateTime,
                timeZone: "UTC",
              };
            }
          }
          
          if (status !== undefined) {
            taskBody.status = status;
          }
          
          if (categories !== undefined) {
            taskBody.categories = categories;
          }
          
          // Make sure we have at least one property to update
          if (Object.keys(taskBody).length === 0) {
            return {
              content: [
                {
                  type: "text",
                  text: "No properties provided for update. Please specify at least one property to change.",
                },
              ],
            };
          }
    
          const response = await makeGraphRequest<Task>(
            `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}`,
            token,
            "PATCH",
            taskBody
          );
          
          if (!response) {
            return {
              content: [
                {
                  type: "text",
                  text: `Failed to update task with ID: ${taskId} in list: ${listId}`,
                },
              ],
            };
          }
    
          return {
            content: [
              {
                type: "text",
                text: `Task updated successfully!\nID: ${response.id}\nTitle: ${response.title}`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error updating task: ${error}`,
              },
            ],
          };
        }
      }
    );

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations provided, the description must explain behavioral traits, but it only says 'allows changing any properties' without covering partial vs full update, error handling, required resources, or permissions. The phrase 'any properties' is also misleading because the schema restricts updatable fields.

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

Conciseness4/5

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

The description is two short sentences with key information front-loaded. It is concise, though the second sentence is somewhat generic and could be tightened.

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 11 parameters, no annotations, and no output schema, the description is insufficient. It fails to explain partial update semantics, the necessity of listId/taskId, error conditions, or what a successful update returns.

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 fully documents all 11 parameters. The description adds marginal value by naming a few examples ('title, due date, importance') but does not provide additional semantics beyond what the schema already contains.

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 a specific verb ('Update') and resource ('existing task in Microsoft Todo'), clearly distinguishing it from sibling tools like create-task and delete-task. It also mentions scope (Microsoft Todo), making the tool's purpose unambiguous.

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 phrase 'Update an existing task' implies use when modifying an existing task rather than creating or deleting one, but it does not explicitly state when to prefer this tool over alternatives. No exclusions or alternative tool names are provided.

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