Skip to main content
Glama

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
NameRequiredDescriptionDefault
task_idYesThe ID of the task to add a comment to
contentYesThe content of the comment to add

Implementation Reference

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

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/bkotos/todoist-mcp'

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