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
| Name | Required | Description | Default |
|---|---|---|---|
| listId | Yes | ID of the task list | |
| taskId | Yes | ID of the task | |
| displayName | Yes | Text content of the checklist item | |
| isChecked | No | Whether the item is checked off |
Implementation Reference
- src/todo-index.ts:1208-1278 (registration)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}`, }, ], }; } } );
- src/todo-index.ts:1217-1277 (handler)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}`, }, ], }; } }
- src/todo-index.ts:1211-1216 (schema)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") },
- src/todo-index.ts:384-390 (schema)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; }