Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

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
NameRequiredDescriptionDefault
listIdYesID of the task list to update
displayNameYesNew name for the task list

Implementation Reference

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

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