Skip to main content
Glama

add_checklist_item

Add a new task to a checklist with details like task name, description, context, and position. Enables AI agents to manage and track progress on complex tasks efficiently.

Instructions

Adds a new item to the checklist.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
context_and_planNoRelated information, files the agent should read, and more details from other tasks, as well as a detailed plan for this task
detailed_descriptionYesA longer description about what we want to achieve with this task
doneNoWhether the task is already completed
positionNoOptional position to insert the task (0-based index). If not provided, the task will be added at the end.
taskYesA short yet comprehensive name for the task

Implementation Reference

  • The core handler function for the 'add_checklist_item' tool. It validates inputs, reads current task data, creates and inserts the new checklist item (with optional position), updates progress via writeTaskData, and returns success or error response.
    private async addChecklistItem(args: any): Promise<any> { if (!args?.task || !args?.detailed_description) { throw new McpError(ErrorCode.InvalidParams, 'Task and detailed description are required'); } try { const taskData = await this.readTaskData(); // Create the new checklist item const newItem: ChecklistItem = { task: args.task, detailed_description: args.detailed_description, context_and_plan: args.context_and_plan, done: args.done || false }; // Add the item to the checklist at the specified position or at the end if (args.position !== undefined && args.position >= 0 && args.position <= taskData.checklist.length) { taskData.checklist.splice(args.position, 0, newItem); } else { taskData.checklist.push(newItem); } // Write the updated task data to the file await this.writeTaskData(taskData); return { content: [ { type: 'text', text: 'Checklist item added successfully.', }, ], }; } catch (error) { console.error('Error adding checklist item:', error); return { content: [ { type: 'text', text: `Error adding checklist item: ${error instanceof Error ? error.message : String(error)}`, }, ], isError: true, }; } }
  • Tool definition including name, description, and input schema for 'add_checklist_item', defining the expected parameters and validation.
    { name: 'add_checklist_item', description: 'Adds a new item to the checklist.', inputSchema: { type: 'object', properties: { task: { type: 'string', description: 'A short yet comprehensive name for the task' }, detailed_description: { type: 'string', description: 'A longer description about what we want to achieve with this task' }, context_and_plan: { type: 'string', description: 'Related information, files the agent should read, and more details from other tasks, as well as a detailed plan for this task' }, done: { type: 'boolean', description: 'Whether the task is already completed', default: false }, position: { type: 'number', description: 'Optional position to insert the task (0-based index). If not provided, the task will be added at the end.' } }, required: ['task', 'detailed_description'] } },
  • src/index.ts:430-431 (registration)
    Dispatcher registration in the CallToolRequestSchema handler switch statement, routing calls to the addChecklistItem method.
    case 'add_checklist_item': return await this.addChecklistItem(request.params.arguments);
  • TypeScript interface defining the structure of checklist items used in the add_checklist_item tool.
    interface ChecklistItem { done: boolean; task: string; detailed_description: string; context_and_plan?: string; }

Other Tools

Related Tools

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