update-task-list
Modify the name of an existing Microsoft Todo task list container by providing its ID and new display name.
Instructions
Update the name of an existing task list (top-level container) in Microsoft Todo.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listId | Yes | ID of the task list to update | |
| displayName | Yes | New name for the task list |
Implementation Reference
- src/todo-index.ts:544-608 (handler)Complete implementation of the 'update-task-list' tool: registers the tool with MCP server, defines input schema (listId, displayName), and provides the handler function that authenticates via getAccessToken, makes a PATCH request to Microsoft Graph API endpoint /me/todo/lists/{listId} to update the displayName, and returns success/error messages.server.tool( "update-task-list", "Update the name of an existing task list (top-level container) in Microsoft Todo.", { listId: z.string().describe("ID of the task list to update"), displayName: z.string().describe("New name for the task list") }, async ({ listId, displayName }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Prepare the request body const requestBody = { displayName }; // Make the API request to update the task list const response = await makeGraphRequest<TaskList>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}`, token, "PATCH", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to update task list with ID: ${listId}`, }, ], }; } return { content: [ { type: "text", text: `Task list updated successfully!\nNew name: ${response.displayName}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error updating task list: ${error}`, }, ], }; } } );