create_task_comment
Add comments to Todoist tasks to provide context, updates, or instructions. This tool enables users to annotate tasks with additional information through Claude Desktop.
Instructions
Create a new comment on a specific Todoist task. The comment will automatically include a signature indicating it was created using Claude.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The ID of the task to add a comment to | |
| content | Yes | The content of the comment to add |
Implementation Reference
- src/tools/comments.ts:62-107 (handler)The handler function that executes the create_task_comment tool logic, invoking the service function and returning structured JSON response.handler: async (args: { task_id: string; content: string }) => { try { const comment = await createTaskComment(args.task_id, args.content); return { content: [ { type: 'text', text: JSON.stringify( { success: true, message: 'Comment created successfully', comment: { id: comment.id, content: comment.content, posted: comment.posted, posted_uid: comment.posted_uid, attachment: comment.attachment, }, }, null, 2 ), }, ], }; } catch (error) { return { content: [ { type: 'text', text: JSON.stringify( { success: false, message: 'Failed to create comment', error: error instanceof Error ? error.message : 'Unknown error', }, null, 2 ), }, ], }; } }, };
- src/tools/comments.ts:43-61 (schema)The schema definition for the create_task_comment tool, including name, description, and input schema.schema: { name: 'create_task_comment', description: 'Create a new comment on a specific Todoist task. The comment will automatically include a signature indicating it was created using Claude.', inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'The ID of the task to add a comment to', }, content: { type: 'string', description: 'The content of the comment to add', }, }, required: ['task_id', 'content'], }, },
- src/handlers/tool-request-handler.ts:50-64 (registration)Registration of the create_task_comment handler in the toolsWithArgs registry used by handleToolRequest.const toolsWithArgs: Record<string, (args: any) => Promise<ToolResponse>> = { get_task_comments: getTaskCommentsTool.handler, create_project_label: createProjectLabelTool.handler, create_task_comment: createTaskCommentTool.handler, update_task: updateTaskTool.handler, create_task: createTaskTool.handler, move_task: moveTaskTool.handler, get_tasks_with_label: getTasksWithLabelTool.handler, complete_task: completeTaskTool.handler, uncomplete_task: uncompleteTaskTool.handler, search_tasks: searchTasksTool.handler, search_tasks_using_and: searchTasksUsingAndTool.handler, search_tasks_using_or: searchTasksUsingOrTool.handler, complete_becky_task: completeBeckyTaskTool.handler, };
- The service helper function that creates a Todoist task comment with an appended Claude signature, delegating to createCommentInternal.export async function createTaskComment( taskId: string, content: string ): Promise<CommentResult> { try { const commentContent = `${content}\n\n*(commented using Claude)*`; return await createCommentInternal(taskId, commentContent); } catch (error) { throw new Error(`Failed to create task comment: ${getErrorMessage(error)}`); } }