remove_checklist_item
Remove a specific item from a checklist by its index position to maintain task organization and progress tracking.
Instructions
Removes a checklist item.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | The index of the checklist item to remove (0-based) |
Implementation Reference
- src/index.ts:866-905 (handler)The core handler function that validates the index parameter, reads the task data, removes the checklist item using array.splice, updates progress by saving to file, and returns success or error response.private async removeChecklistItem(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}`); } // Remove the checklist item taskData.checklist.splice(args.index, 1); // Write the updated task data to the file await this.writeTaskData(taskData); return { content: [ { type: 'text', text: 'Checklist item removed successfully.', }, ], }; } catch (error) { console.error('Error removing checklist item:', error); return { content: [ { type: 'text', text: `Error removing checklist item: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
- src/index.ts:295-304 (schema)Input schema definition requiring a numeric 'index' (0-based) for the checklist item to remove.inputSchema: { type: 'object', properties: { index: { type: 'number', description: 'The index of the checklist item to remove (0-based)' } }, required: ['index'] }
- src/index.ts:292-305 (registration)Tool registration in the ListTools handler, providing name, description, and input schema.{ name: 'remove_checklist_item', description: 'Removes a checklist item.', inputSchema: { type: 'object', properties: { index: { type: 'number', description: 'The index of the checklist item to remove (0-based)' } }, required: ['index'] } },
- src/index.ts:438-439 (registration)Dispatch case in the CallToolRequest handler that routes to the removeChecklistItem method.case 'remove_checklist_item': return await this.removeChecklistItem(request.params.arguments);