Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

update-checklist-item

Modify subtask details by updating text content or toggling completion status in Microsoft Todo using list, task, and checklist item IDs.

Instructions

Update an existing checklist item (subtask). Allows changing the text content or completion status of the subtask.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
checklistItemIdYesID of the checklist item to update
displayNameNoNew text content of the checklist item
isCheckedNoWhether the item is checked off
listIdYesID of the task list
taskIdYesID of the task

Implementation Reference

  • The handler function that executes the update-checklist-item tool. It handles authentication, constructs the PATCH request body with optional displayName and isChecked, calls the Microsoft Graph API to update the checklist item, and returns a formatted response.
    async ({ listId, taskId, checklistItemId, displayName, isChecked }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Prepare the update body, including only the fields that are provided const requestBody: any = {}; if (displayName !== undefined) { requestBody.displayName = displayName; } if (isChecked !== undefined) { requestBody.isChecked = isChecked; } // Make sure we have at least one property to update if (Object.keys(requestBody).length === 0) { return { content: [ { type: "text", text: "No properties provided for update. Please specify either displayName or isChecked.", }, ], }; } // Make the API request to update the checklist item const response = await makeGraphRequest<ChecklistItem>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems/${checklistItemId}`, token, "PATCH", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to update checklist item with ID: ${checklistItemId}`, }, ], }; } const statusText = response.isChecked ? "Checked" : "Not checked"; return { content: [ { type: "text", text: `Checklist item updated successfully!\nContent: ${response.displayName}\nStatus: ${statusText}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error updating checklist item: ${error}`, }, ], }; } }
  • Zod schema defining the input parameters for the update-checklist-item tool: listId, taskId, checklistItemId (required), displayName and isChecked (optional).
    listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), checklistItemId: z.string().describe("ID of the checklist item to update"), displayName: z.string().optional().describe("New text content of the checklist item"), isChecked: z.boolean().optional().describe("Whether the item is checked off") },
  • The server.tool registration call that registers the 'update-checklist-item' tool with its description, input schema, and handler function.
    server.tool( "update-checklist-item", "Update an existing checklist item (subtask). Allows changing the text content or completion status of the subtask.", { listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), checklistItemId: z.string().describe("ID of the checklist item to update"), displayName: z.string().optional().describe("New text content of the checklist item"), isChecked: z.boolean().optional().describe("Whether the item is checked off") }, async ({ listId, taskId, checklistItemId, displayName, isChecked }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Prepare the update body, including only the fields that are provided const requestBody: any = {}; if (displayName !== undefined) { requestBody.displayName = displayName; } if (isChecked !== undefined) { requestBody.isChecked = isChecked; } // Make sure we have at least one property to update if (Object.keys(requestBody).length === 0) { return { content: [ { type: "text", text: "No properties provided for update. Please specify either displayName or isChecked.", }, ], }; } // Make the API request to update the checklist item const response = await makeGraphRequest<ChecklistItem>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems/${checklistItemId}`, token, "PATCH", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to update checklist item with ID: ${checklistItemId}`, }, ], }; } const statusText = response.isChecked ? "Checked" : "Not checked"; return { content: [ { type: "text", text: `Checklist item updated successfully!\nContent: ${response.displayName}\nStatus: ${statusText}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error updating checklist item: ${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