mark_task_done
Mark a checklist item as completed to track progress in task breakdown workflows. Specify the item index to update its status.
Instructions
Marks a checklist item as done.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | The index of the checklist item to mark as done (0-based) |
Implementation Reference
- src/index.ts:782-821 (handler)The handler function for 'mark_task_done' tool. It validates the index, reads the task data from config file, sets the checklist item's 'done' to true, updates progress metadata, writes back to file, and returns success message.private async markTaskDone(args: any): Promise<any> { if (args?.index === undefined) { throw new McpError(ErrorCode.InvalidParams, 'Index is required'); } try { const taskData = await this.readTaskData(); // Check if the index is valid if (args.index < 0 || args.index >= taskData.checklist.length) { throw new McpError(ErrorCode.InvalidParams, `Invalid index: ${args.index}`); } // Mark the checklist item as done taskData.checklist[args.index].done = true; // Write the updated task data to the file await this.writeTaskData(taskData); return { content: [ { type: 'text', text: 'Task marked as done.', }, ], }; } catch (error) { console.error('Error marking task as done:', error); return { content: [ { type: 'text', text: `Error marking task as done: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
- src/index.ts:267-276 (schema)Input schema for the 'mark_task_done' tool, requiring a 0-based index of the checklist item.inputSchema: { type: 'object', properties: { index: { type: 'number', description: 'The index of the checklist item to mark as done (0-based)' } }, required: ['index'] }
- src/index.ts:264-277 (registration)Registration of the 'mark_task_done' tool in the ListTools response, defining name, description, and input schema.{ name: 'mark_task_done', description: 'Marks a checklist item as done.', inputSchema: { type: 'object', properties: { index: { type: 'number', description: 'The index of the checklist item to mark as done (0-based)' } }, required: ['index'] } },
- src/index.ts:434-435 (registration)Dispatch case in the CallToolRequest handler that routes 'mark_task_done' calls to the markTaskDone method.case 'mark_task_done': return await this.markTaskDone(request.params.arguments);