todoist_projects
Manage Todoist projects by creating, updating, archiving, and organizing them with metadata support for efficient task organization.
Instructions
Complete project management for Todoist - create, read, update, archive, and query projects with metadata support
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform | |
| color | No | Project color | |
| include_archived | No | Include archived projects (for list) | |
| is_favorite | No | Mark as favorite | |
| name | No | Project name | |
| parent_id | No | Parent project ID | |
| project_id | No | Project ID (required for get/update/delete/archive/unarchive) | |
| view_style | No | View style |
Implementation Reference
- src/tools/todoist-projects.ts:173-232 (handler)Main execute method of TodoistProjectsTool: validates input, routes to action-specific handlers (create/get/update/delete/list/archive/unarchive), adds metadata, handles errors.async execute(input: unknown): Promise<TodoistProjectsOutput> { const startTime = Date.now(); try { // Validate API token before processing request await TokenValidatorSingleton.validateOnce(); // Validate input const validatedInput = TodoistProjectsInputSchema.parse(input); // Validate action-specific required fields this.validateActionRequirements(validatedInput); let result: TodoistProjectsOutput; // 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': result = await this.handleList(validatedInput); break; case 'archive': result = await this.handleArchive(validatedInput); break; case 'unarchive': result = await this.handleUnarchive(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); } }
- src/tools/todoist-projects.ts:12-36 (schema)Zod input schema (TodoistProjectsInputSchema) defining supported actions and parameters for the tool./** * Input schema for the todoist_projects tool * Flattened for MCP client compatibility */ const TodoistProjectsInputSchema = z.object({ action: z.enum([ 'create', 'get', 'update', 'delete', 'list', 'archive', 'unarchive', ]), // Project ID (for get, update, delete, archive, unarchive) project_id: z.string().optional(), // Create/Update fields name: z.string().optional(), parent_id: z.string().optional(), color: z.string().optional(), is_favorite: z.boolean().optional(), view_style: z.enum(['list', 'board']).optional(), // List fields include_archived: z.boolean().optional(), });
- src/tools/todoist-projects.ts:90-136 (schema)Static getToolDefinition() providing MCP tool definition with name, description, and detailed inputSchema./** * Get the MCP tool definition */ static getToolDefinition() { return { name: 'todoist_projects', description: 'Complete project management for Todoist - create, read, update, archive, and query projects with metadata support', inputSchema: { type: 'object' as const, properties: { action: { type: 'string', enum: [ 'create', 'get', 'update', 'delete', 'list', 'archive', 'unarchive', ], description: 'Action to perform', }, project_id: { type: 'string', description: 'Project ID (required for get/update/delete/archive/unarchive)', }, name: { type: 'string', description: 'Project name' }, parent_id: { type: 'string', description: 'Parent project ID' }, color: { type: 'string', description: 'Project color' }, is_favorite: { type: 'boolean', description: 'Mark as favorite' }, view_style: { type: 'string', enum: ['list', 'board'], description: 'View style', }, include_archived: { type: 'boolean', description: 'Include archived projects (for list)', }, }, required: ['action'], }, }; }
- src/server/impl.ts:63-73 (registration)Instantiation of TodoistProjectsTool with config and registration in the server's tools Map by name 'todoist_projects'.const projectsTool = new TodoistProjectsTool(this.config); const sectionsTool = new TodoistSectionsTool(this.config); 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);
- src/server/impl.ts:104-104 (registration)Registration of tool definition in the listTools handler response using static getToolDefinition().TodoistProjectsTool.getToolDefinition(),