Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

delete-task-list

Remove a task list and its associated tasks from Microsoft Todo using the specified list ID for efficient task management and organization.

Instructions

Delete a task list (top-level container) from Microsoft Todo. This will remove the list and all tasks within it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the task list to delete

Implementation Reference

  • The async handler function that gets an access token, constructs the Microsoft Graph API DELETE endpoint for the specified task list ID, performs the deletion, and returns success or error message.
    async ({ listId }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Make a DELETE request to the Microsoft Graph API const url = `${MS_GRAPH_BASE}/me/todo/lists/${listId}`; console.error(`Deleting task list: ${url}`); // The DELETE method doesn't return a response body, so we expect null await makeGraphRequest<null>( url, token, "DELETE" ); // If we get here, the delete was successful (204 No Content) return { content: [ { type: "text", text: `Task list with ID: ${listId} was successfully deleted.`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error deleting task list: ${error}`, }, ], }; } }
  • Zod input schema defining the required 'listId' parameter.
    { listId: z.string().describe("ID of the task list to delete") },
  • MCP server.tool registration defining the tool name, description, input schema, and handler function.
    server.tool( "delete-task-list", "Delete a task list (top-level container) from Microsoft Todo. This will remove the list and all tasks within it.", { listId: z.string().describe("ID of the task list to delete") }, async ({ listId }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Make a DELETE request to the Microsoft Graph API const url = `${MS_GRAPH_BASE}/me/todo/lists/${listId}`; console.error(`Deleting task list: ${url}`); // The DELETE method doesn't return a response body, so we expect null await makeGraphRequest<null>( url, token, "DELETE" ); // If we get here, the delete was successful (204 No Content) return { content: [ { type: "text", text: `Task list with ID: ${listId} was successfully deleted.`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error deleting 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