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

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