update_checklist_item
Update the text or completion status of a checklist item inside a task. Manage subtask progress accurately.
Instructions
Update text/completed on a checklist item.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | ||
| itemId | Yes | ||
| text | No | ||
| completed | No |
Implementation Reference
- index.js:188-201 (schema)Input schema definition for update_checklist_item tool. Defines required params: taskId, itemId, and optional params: text (string) and completed (boolean).
{ name: "update_checklist_item", description: "Update text/completed on a checklist item.", inputSchema: { type: "object", properties: { taskId: { type: "string" }, itemId: { type: "string" }, text: { type: "string" }, completed: { type: "boolean" }, }, required: ["taskId", "itemId"], }, }, - index.js:413-416 (handler)Handler function for update_checklist_item. Makes a PUT request to /tasks/{taskId}/checklist/{itemId} with the updates object (spread from rest params).
update_checklist_item: async ({ taskId, itemId, ...updates }) => { await api("PUT", `/tasks/${taskId}/checklist/${itemId}`, updates); return ok(`Updated checklist item ${itemId}.`); }, - index.js:188-201 (registration)The tool is registered in the tools[] array (line 58-367) alongside all other tools. The ListToolsRequestSchema handler at line 480 returns this array.
{ name: "update_checklist_item", description: "Update text/completed on a checklist item.", inputSchema: { type: "object", properties: { taskId: { type: "string" }, itemId: { type: "string" }, text: { type: "string" }, completed: { type: "boolean" }, }, required: ["taskId", "itemId"], }, }, - index.js:23-51 (helper)The api() helper function used by the handler to make HTTP requests to the Habitica API.
async function api(method, path, body) { const url = `${API_BASE}${path}`; const headers = { "x-api-user": USER_ID, "x-api-key": API_TOKEN, "x-client": `${USER_ID}-${APP_ID}`, "Content-Type": "application/json", }; const res = await fetch(url, { method, headers, body: body === undefined ? undefined : JSON.stringify(body), }); const text = await res.text(); let payload; try { payload = text ? JSON.parse(text) : {}; } catch { payload = { raw: text }; } if (!res.ok) { const msg = payload?.message || payload?.error || res.statusText; throw new McpError( ErrorCode.InternalError, `Habitica API ${res.status}: ${msg}`, ); } return payload; }