Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

create-checklist-item

Add a checklist item to break down Microsoft Todo tasks into smaller, manageable steps for better organization and progress tracking.

Instructions

Create a new checklist item (subtask) for a task. Checklist items help break down a task into smaller, manageable steps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
listIdYesID of the task list
taskIdYesID of the task
displayNameYesText content of the checklist item
isCheckedNoWhether the item is checked off

Implementation Reference

  • Registers the 'create-checklist-item' MCP tool, including its description, input schema, and handler function.
    server.tool( "create-checklist-item", "Create a new checklist item (subtask) for a task. Checklist items help break down a task into smaller, manageable steps.", { listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), displayName: z.string().describe("Text content of the checklist item"), isChecked: z.boolean().optional().describe("Whether the item is checked off") }, async ({ listId, taskId, displayName, isChecked }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Prepare the request body const requestBody: any = { displayName }; if (isChecked !== undefined) { requestBody.isChecked = isChecked; } // Make the API request to create the checklist item const response = await makeGraphRequest<ChecklistItem>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems`, token, "POST", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to create checklist item for task: ${taskId}`, }, ], }; } return { content: [ { type: "text", text: `Checklist item created successfully!\nContent: ${response.displayName}\nID: ${response.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error creating checklist item: ${error}`, }, ], }; } } );
  • The main handler function for the tool: authenticates via getAccessToken, constructs the request body with displayName and optional isChecked, performs a POST request to the Microsoft Graph API endpoint for checklistItems, and returns formatted success or error messages.
    async ({ listId, taskId, displayName, isChecked }) => { try { const token = await getAccessToken(); if (!token) { return { content: [ { type: "text", text: "Failed to authenticate with Microsoft API", }, ], }; } // Prepare the request body const requestBody: any = { displayName }; if (isChecked !== undefined) { requestBody.isChecked = isChecked; } // Make the API request to create the checklist item const response = await makeGraphRequest<ChecklistItem>( `${MS_GRAPH_BASE}/me/todo/lists/${listId}/tasks/${taskId}/checklistItems`, token, "POST", requestBody ); if (!response) { return { content: [ { type: "text", text: `Failed to create checklist item for task: ${taskId}`, }, ], }; } return { content: [ { type: "text", text: `Checklist item created successfully!\nContent: ${response.displayName}\nID: ${response.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error creating checklist item: ${error}`, }, ], }; } }
  • Zod input schema defining the required parameters listId, taskId, displayName and optional isChecked for creating a checklist item.
    { listId: z.string().describe("ID of the task list"), taskId: z.string().describe("ID of the task"), displayName: z.string().describe("Text content of the checklist item"), isChecked: z.boolean().optional().describe("Whether the item is checked off") },
  • TypeScript interface defining the structure of a ChecklistItem, used for typing the API response in the handler.
    interface ChecklistItem { id: string; displayName: string; isChecked: boolean; createdDateTime?: string; }

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