Skip to main content
Glama

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
NameRequiredDescriptionDefault
indexYesThe index of the checklist item to remove (0-based)

Implementation Reference

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

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/landicefu/divide-and-conquer-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server