Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

update-task-list

Modify the name of an existing task list in Microsoft Todo by specifying the list ID and providing a new display name for accurate organization and management.

Instructions

Update the name of an existing task list (top-level container) in Microsoft Todo.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
displayNameYesNew name for the task list
listIdYesID of the task list to update

Implementation Reference

  • The core handler function that authenticates with Microsoft Graph API using getAccessToken(), constructs the PATCH request body with the new displayName, calls makeGraphRequest to update the task list at /me/todo/lists/{listId}, and returns success or error messages.
    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}`, }, ], }; } }
  • Zod schema for input parameters: listId (required string ID of the task list) and displayName (required new name string). Used for input validation in the tool registration.
    { listId: z.string().describe("ID of the task list to update"), displayName: z.string().describe("New name for the task list") },
  • MCP server tool registration for 'update-task-list', including the tool name, description, input schema with Zod, and reference to the handler function.
    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}`, }, ], }; } } );

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