complete_becky_task
Complete a shared Todoist task by setting its due date to today, adding a completion comment, and moving it to the designated inbox project.
Instructions
Complete a Brian shared task (assigned to Brian from Becky) by setting due date to today, adding a completion comment, and moving it to Becky inbox project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to complete |
Implementation Reference
- src/tools/task-operations.ts:391-434 (handler)The handler function for the 'complete_becky_task' tool. It takes a task_id argument, calls the completeBeckyTask helper function, logs execution, and returns a success or error message in the required MCP format.export const completeBeckyTaskTool: Tool = { schema: { name: 'complete_becky_task', description: 'Complete a Brian shared task (assigned to Brian from Becky) by setting due date to today, adding a completion comment, and moving it to Becky inbox project', inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'The ID of the task to complete', }, }, required: ['task_id'], }, }, handler: async (args: { task_id: string }) => { try { console.error('Executing complete_becky_task...'); await completeBeckyTask(args.task_id); console.error('complete_becky_task completed successfully'); return { content: [ { type: 'text', text: 'Task completed successfully. Due date set to today, completion comment added, and task moved to Becky inbox project.', }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error: ${ error instanceof Error ? error.message : 'Unknown error' }`, }, ], }; } }, };
- The core helper function implementing the logic to complete a Becky task: sets due date to 'today', adds a specific completion comment, and moves the task to the 'Becky inbox - per Brian' project.export async function completeBeckyTask(taskId: string): Promise<void> { try { const commentContent = buildCommentContent(); // Find the Becky inbox project const beckyInboxProjectId = await findProjectByName( 'Becky inbox - per Brian' ); // Update the task due string to today await updateTask({ taskId, dueString: 'today', }); // Add the completion comment await createAutomatedTaskComment(taskId, commentContent); // Move the task to the Becky inbox project await moveTask(taskId, beckyInboxProjectId); } catch (error) { throw new Error(`Failed to complete Becky task: ${getErrorMessage(error)}`); } }
- src/handlers/tool-request-handler.ts:62-64 (registration)Registration of the complete_becky_task tool handler in the toolsWithArgs registry used by handleToolRequest.search_tasks_using_or: searchTasksUsingOrTool.handler, complete_becky_task: completeBeckyTaskTool.handler, };
- src/index.ts:112-112 (schema)The tool's schema is registered in the MCP server's listTools handler response.completeBeckyTaskTool.schema,
- src/tools/index.ts:8-8 (registration)Re-export of the completeBeckyTaskTool for use in other modules.completeBeckyTaskTool,