Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

create-task-list

Organize tasks efficiently by creating new task lists in Microsoft Todo. Define clear categories or projects to streamline task management and improve productivity.

Instructions

Create a new task list (top-level container) in Microsoft Todo to help organize your tasks into categories or projects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
displayNameYesName of the new task list

Implementation Reference

  • The handler function for the 'create-task-list' tool. It authenticates using getAccessToken, prepares a POST request body with the displayName, calls makeGraphRequest to create the list at /me/todo/lists, and returns formatted success or error messages.
    async ({ 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 create the task list const response = await makeGraphRequest<TaskList>( `${MS_GRAPH_BASE}/me/todo/lists`, token, "POST", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to create task list: ${displayName}`, }, ], }; } return { content: [ { type: "text", text: `Task list created successfully!\nName: ${response.displayName}\nID: ${response.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error creating task list: ${error}`, }, ], }; } }
  • Input schema for the 'create-task-list' tool using Zod, defining the required 'displayName' parameter as a string.
    { displayName: z.string().describe("Name of the new task list") },
  • Registration of the 'create-task-list' tool on the McpServer instance, specifying name, description, input schema, and handler function.
    server.tool( "create-task-list", "Create a new task list (top-level container) in Microsoft Todo to help organize your tasks into categories or projects.", { displayName: z.string().describe("Name of the new task list") }, async ({ 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 create the task list const response = await makeGraphRequest<TaskList>( `${MS_GRAPH_BASE}/me/todo/lists`, token, "POST", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to create task list: ${displayName}`, }, ], }; } return { content: [ { type: "text", text: `Task list created successfully!\nName: ${response.displayName}\nID: ${response.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error creating task list: ${error}`, }, ], }; } } );
  • TypeScript interface definition for TaskList, used as the generic type for the response in makeGraphRequest within the handler.
    interface TaskList { id: string; displayName: string; isOwner?: boolean; isShared?: boolean; wellknownListName?: string; // 'none', 'defaultList', 'flaggedEmails', 'unknownFutureValue' }

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