Skip to main content
Glama
jhirono

Microsoft Todo MCP Service

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
NameRequiredDescriptionDefault
displayNameYesText content of the checklist item
isCheckedNoWhether the item is checked off
listIdYesID of the task list
taskIdYesID of the task

Implementation Reference

  • 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}`, }, ], }; } }
  • 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") },
  • 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}`, }, ], }; } } );
  • 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; }

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