create-checklist-item
Add a checklist item to a task in Microsoft Todo to break it into smaller, actionable steps using list ID, task ID, and item text.
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 |
|---|---|---|---|
| displayName | Yes | Text content of the checklist item | |
| isChecked | No | Whether the item is checked off | |
| listId | Yes | ID of the task list | |
| taskId | Yes | ID of the task |
Implementation Reference
- src/todo-index.ts:1217-1277 (handler)The async handler function that gets an access token, prepares the request body with displayName and optional isChecked, makes a POST request to Microsoft Graph API endpoint for checklistItems, and returns success or error message.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 parameters for the create-checklist-item tool: listId, taskId, displayName (required strings), isChecked (optional boolean).{ 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:1208-1278 (registration)The server.tool registration call that defines and registers the 'create-checklist-item' tool with its name, 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:384-389 (schema)TypeScript interface defining the structure of ChecklistItem used in the response typing for the tool.interface ChecklistItem { id: string; displayName: string; isChecked: boolean; createdDateTime?: string; }