Skip to main content
Glama

todoist_comments

Manage comments on Todoist tasks and projects by creating, reading, updating, deleting, and listing comments with file attachment support and 15,000 character limit.

Instructions

Comment management for Todoist tasks and projects - create, read, update, delete comments with 15,000 character limit and file attachment support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform
attachmentNoFile attachment
comment_idNoComment ID (required for get/update/delete)
contentNoComment content (max 15,000 characters)
project_idNoProject ID (for create/list_by_project)
task_idNoTask ID (for create/list_by_task)

Implementation Reference

  • Main execute method of TodoistCommentsTool that parses input, validates requirements, routes to specific action handlers (create/get/update/delete/list), adds metadata, and handles errors.
    async execute(input: unknown): Promise<TodoistCommentsOutput> { const startTime = Date.now(); try { // Validate API token before processing request await TokenValidatorSingleton.validateOnce(); // Validate input const validatedInput = TodoistCommentsInputSchema.parse(input); // Validate action-specific required fields this.validateActionRequirements(validatedInput); let result: TodoistCommentsOutput; // Route to appropriate handler based on action switch (validatedInput.action) { case 'create': result = await this.handleCreate(validatedInput); break; case 'get': result = await this.handleGet(validatedInput); break; case 'update': result = await this.handleUpdate(validatedInput); break; case 'delete': result = await this.handleDelete(validatedInput); break; case 'list_by_task': case 'list_by_project': result = await this.handleList(validatedInput); break; default: throw new ValidationError('Invalid action specified'); } // Add operation metadata const operationTime = Date.now() - startTime; const rateLimitStatus = this.apiService.getRateLimitStatus(); result.metadata = { ...result.metadata, operation_time: operationTime, rate_limit_remaining: rateLimitStatus.rest.remaining, rate_limit_reset: new Date( rateLimitStatus.rest.resetTime ).toISOString(), }; return result; } catch (error) { return this.handleError(error, Date.now() - startTime); } }
  • Zod input schema validation for todoist_comments tool parameters including action, IDs, content, and attachment.
    const TodoistCommentsInputSchema = z.object({ action: z.enum([ 'create', 'get', 'update', 'delete', 'list_by_task', 'list_by_project', ]), // Comment ID (for get, update, delete) comment_id: z.string().optional(), // Task/Project ID (for create, list_by_task, list_by_project) task_id: z.string().optional(), project_id: z.string().optional(), // Create/Update fields content: z.string().optional(), // Attachment (for create) attachment: z .object({ resource_type: z.string(), file_url: z.string(), file_name: z.string(), file_size: z.number().int(), file_type: z.string(), }) .optional(), });
  • Instantiation of TodoistCommentsTool with config and registration in the tools Map under name 'todoist_comments'.
    const commentsTool = new TodoistCommentsTool(this.config); const filtersTool = new TodoistFiltersTool(this.config); const remindersTool = new TodoistRemindersTool(this.config); const labelsTool = new TodoistLabelsTool(this.config); const bulkTasksTool = new TodoistBulkTasksTool(this.config); // Register tools in the map this.tools.set('todoist_tasks', tasksTools); this.tools.set('todoist_projects', projectsTool); this.tools.set('todoist_sections', sectionsTool); this.tools.set('todoist_comments', commentsTool);
  • Static method returning the MCP tool definition including name, description, and inputSchema for todoist_comments.
    static getToolDefinition() { return { name: 'todoist_comments', description: 'Comment management for Todoist tasks and projects - create, read, update, delete comments with 15,000 character limit and file attachment support', inputSchema: { type: 'object' as const, properties: { action: { type: 'string', enum: [ 'create', 'get', 'update', 'delete', 'list_by_task', 'list_by_project', ], description: 'Action to perform', }, comment_id: { type: 'string', description: 'Comment ID (required for get/update/delete)', }, task_id: { type: 'string', description: 'Task ID (for create/list_by_task)', }, project_id: { type: 'string', description: 'Project ID (for create/list_by_project)', }, content: { type: 'string', description: 'Comment content (max 15,000 characters)', }, attachment: { type: 'object', description: 'File attachment', properties: { resource_type: { type: 'string' }, file_url: { type: 'string' }, file_name: { type: 'string' }, file_size: { type: 'number' }, file_type: { type: 'string' }, }, }, }, required: ['action'], }, }; }
  • Helper method to validate action-specific input requirements before execution.
    private validateActionRequirements(input: TodoistCommentsInput): void { switch (input.action) { case 'create': if (!input.content) throw new ValidationError('content is required for create action'); // Either task_id or project_id must be provided if (!input.task_id && !input.project_id) throw new ValidationError( 'Either task_id or project_id is required for create action' ); break; case 'get': case 'delete': if (!input.comment_id) throw new ValidationError( `comment_id is required for ${input.action} action` ); break; case 'update': if (!input.comment_id) throw new ValidationError('comment_id is required for update action'); if (!input.content) throw new ValidationError('content is required for update action'); break; case 'list_by_task': if (!input.task_id) throw new ValidationError( 'task_id is required for list_by_task action' ); break; case 'list_by_project': if (!input.project_id) throw new ValidationError( 'project_id is required for list_by_project action' ); break; default: throw new ValidationError('Invalid action specified'); } }

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

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