Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

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

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is an update operation (implying mutation) and mentions what can be changed, but lacks critical information: whether this requires specific permissions, if changes are reversible, what happens to unspecified properties (partial vs. full updates), error conditions, or response format. For a mutation tool with 11 parameters, this is insufficient.

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 a single, efficient sentence that front-loads the core purpose. It wastes no words but could be slightly more structured by separating usage context from capability listing. Every part earns its place, though it's brief given the tool's complexity.

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 (mutation with 11 parameters, no annotations, no output schema), the description is incomplete. It covers the basic purpose but lacks behavioral context (permissions, side effects), usage guidelines, and output expectations. For a tool that modifies data in a system like Microsoft Todo, this leaves significant gaps for an AI agent.

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 with their types, descriptions, enums, and required status. The description adds minimal value beyond the schema by generically mentioning 'any properties including title, due date, importance, etc.' but provides no additional syntax, format details, or constraints. This meets the baseline for high schema coverage.

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 verb ('Update') and resource ('an existing task in Microsoft Todo'), and specifies the scope ('allows changing any properties'). It distinguishes from siblings like create-task or delete-task by focusing on modification of existing tasks. However, it doesn't explicitly differentiate from update-checklist-item or update-task-list, which are similar update operations on different resources.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing listId and taskId), when to choose update-task over create-task for similar outcomes, or any constraints on usage. The agent must infer usage from the tool name alone.

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