@monadsag/productive-mcp 1.2.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/LICENSE +190 -0
  2. package/NOTICE +6 -0
  3. package/README.md +353 -0
  4. package/build/api/bookings-client.js +249 -0
  5. package/build/api/capacity.js +279 -0
  6. package/build/api/client.js +1296 -0
  7. package/build/api/errors.js +50 -0
  8. package/build/api/invoice-time-entries.js +256 -0
  9. package/build/api/pages-tree.js +106 -0
  10. package/build/api/time-entry-notes.js +75 -0
  11. package/build/api/types.js +1 -0
  12. package/build/auth/logo.js +21 -0
  13. package/build/auth/self-resolver.js +61 -0
  14. package/build/config/index.js +24 -0
  15. package/build/index.js +15 -0
  16. package/build/prompts/timesheet.js +285 -0
  17. package/build/server.js +55 -0
  18. package/build/tools/absences.js +502 -0
  19. package/build/tools/activities.js +140 -0
  20. package/build/tools/bookings.js +531 -0
  21. package/build/tools/budget-services.js +168 -0
  22. package/build/tools/budgets.js +276 -0
  23. package/build/tools/capacity.js +281 -0
  24. package/build/tools/changeset.js +41 -0
  25. package/build/tools/comments.js +469 -0
  26. package/build/tools/companies.js +73 -0
  27. package/build/tools/custom-field-resolver.js +92 -0
  28. package/build/tools/custom-fields.js +155 -0
  29. package/build/tools/folders.js +516 -0
  30. package/build/tools/include-resolver.js +45 -0
  31. package/build/tools/invoice-actions.js +476 -0
  32. package/build/tools/invoice-defaults.js +65 -0
  33. package/build/tools/invoice-time-entries.js +320 -0
  34. package/build/tools/invoices.js +657 -0
  35. package/build/tools/my-tasks.js +100 -0
  36. package/build/tools/page-children.js +129 -0
  37. package/build/tools/pages.js +466 -0
  38. package/build/tools/people.js +147 -0
  39. package/build/tools/projects.js +77 -0
  40. package/build/tools/recent-updates.js +112 -0
  41. package/build/tools/registry.js +409 -0
  42. package/build/tools/subtasks.js +245 -0
  43. package/build/tools/task-backlog.js +106 -0
  44. package/build/tools/task-dependencies.js +244 -0
  45. package/build/tools/task-list-move.js +65 -0
  46. package/build/tools/task-lists.js +535 -0
  47. package/build/tools/task-reposition.js +199 -0
  48. package/build/tools/task-status.js +178 -0
  49. package/build/tools/tasks.js +738 -0
  50. package/build/tools/time-entries.js +736 -0
  51. package/build/tools/time-entry-approval.js +103 -0
  52. package/build/tools/time-entry-delete.js +72 -0
  53. package/build/tools/time-entry-update.js +126 -0
  54. package/build/tools/timers.js +195 -0
  55. package/build/tools/todos.js +342 -0
  56. package/build/tools/tool-helpers.js +114 -0
  57. package/build/tools/toolsets.js +153 -0
  58. package/build/tools/whoami.js +64 -0
  59. package/build/tools/workflow-statuses.js +81 -0
  60. package/build/utils/errors.js +67 -0
  61. package/build/utils/mentions.js +98 -0
  62. package/npm-shrinkwrap.json +1159 -0
  63. package/package.json +79 -0
@@ -0,0 +1,535 @@
1
+ import { z } from 'zod';
2
+ import { toMcpError } from '../utils/errors.js';
3
+ /** Coerce "true"/"false" strings to booleans (some MCP clients send strings). */
4
+ const coerceBoolean = z.preprocess((v) => (v === 'true' ? true : v === 'false' ? false : v), z.boolean());
5
+ const ListTaskListsSchema = z.object({
6
+ board_id: z.string().optional().describe('Filter to Task Lists inside this board/Folder ID'),
7
+ limit: z.coerce
8
+ .number()
9
+ .optional()
10
+ .default(30)
11
+ .describe('Max number of Task Lists to return (default 30, max 200)'),
12
+ });
13
+ export async function listTaskLists(client, args) {
14
+ try {
15
+ const params = ListTaskListsSchema.parse(args || {});
16
+ const response = await client.listTaskLists({
17
+ board_id: params.board_id,
18
+ limit: params.limit,
19
+ });
20
+ if (!response || !response.data || response.data.length === 0) {
21
+ const filterText = params.board_id ? ` for board ${params.board_id}` : '';
22
+ return {
23
+ content: [
24
+ {
25
+ type: 'text',
26
+ text: `No task lists found${filterText}`,
27
+ },
28
+ ],
29
+ };
30
+ }
31
+ const taskListsText = response.data
32
+ .filter((taskList) => taskList && taskList.attributes)
33
+ .map((taskList) => {
34
+ let text = `Task List: ${taskList.attributes.name} (ID: ${taskList.id})`;
35
+ if (taskList.attributes.position !== undefined) {
36
+ text += `\nPosition: ${taskList.attributes.position}`;
37
+ }
38
+ if (taskList.relationships?.board?.data?.id) {
39
+ text += `\nBoard ID: ${taskList.relationships.board.data.id}`;
40
+ }
41
+ return text;
42
+ })
43
+ .join('\n\n');
44
+ return {
45
+ content: [
46
+ {
47
+ type: 'text',
48
+ text: taskListsText,
49
+ },
50
+ ],
51
+ };
52
+ }
53
+ catch (error) {
54
+ throw toMcpError(error);
55
+ }
56
+ }
57
+ export const listTaskListsTool = {
58
+ name: 'list_task_lists',
59
+ description: 'List Task Lists. A Task List lives inside a Folder/Board and groups tasks -- it is NOT the Folder/Board itself. In the hierarchy Project -> Folder/Board -> Task List -> Task, task lists are the layer between a folder/board and its tasks. Pass board_id to get the task lists of one folder/board. Returns up to `limit` results (default 30, max 200).',
60
+ inputSchema: {
61
+ type: 'object',
62
+ properties: {
63
+ board_id: {
64
+ type: 'string',
65
+ description: 'Filter to Task Lists inside this board/Folder ID',
66
+ },
67
+ limit: {
68
+ type: 'number',
69
+ description: 'Max number of Task Lists to return (default 30, max 200)',
70
+ default: 30,
71
+ },
72
+ },
73
+ },
74
+ annotations: { title: 'List task lists', readOnlyHint: true, openWorldHint: true },
75
+ };
76
+ const CreateTaskListSchema = z.object({
77
+ board_id: z.string().describe('The ID of the board/Folder to create the Task List in'),
78
+ project_id: z.string().describe('The ID of the project the board/Folder belongs to'),
79
+ name: z.string().describe('Name for the new Task List'),
80
+ description: z.string().optional().describe('Optional description of the Task List'),
81
+ });
82
+ export async function createTaskList(client, args) {
83
+ try {
84
+ const params = CreateTaskListSchema.parse(args);
85
+ const taskListData = {
86
+ data: {
87
+ type: 'task_lists',
88
+ attributes: {
89
+ name: params.name,
90
+ ...(params.description && { description: params.description }),
91
+ position: 0,
92
+ project_id: params.project_id,
93
+ },
94
+ relationships: {
95
+ board: {
96
+ data: {
97
+ id: params.board_id,
98
+ type: 'boards',
99
+ },
100
+ },
101
+ },
102
+ },
103
+ };
104
+ const response = await client.createTaskList(taskListData);
105
+ let text = `Task list created successfully!\n`;
106
+ text += `Name: ${response.data.attributes.name} (ID: ${response.data.id})`;
107
+ text += `\nBoard ID: ${params.board_id}`;
108
+ return {
109
+ content: [
110
+ {
111
+ type: 'text',
112
+ text: text,
113
+ },
114
+ ],
115
+ };
116
+ }
117
+ catch (error) {
118
+ throw toMcpError(error);
119
+ }
120
+ }
121
+ export const createTaskListTool = {
122
+ name: 'create_task_list',
123
+ description: 'Create a new Task List inside a Folder/Board. This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself. Task lists group the tasks within a folder/board; this is the middle drill-down step create_folder -> create_task_list -> create_task.',
124
+ inputSchema: {
125
+ type: 'object',
126
+ properties: {
127
+ board_id: {
128
+ type: 'string',
129
+ description: 'The ID of the board/Folder to create the Task List in',
130
+ },
131
+ project_id: {
132
+ type: 'string',
133
+ description: 'The ID of the project the board/Folder belongs to',
134
+ },
135
+ name: {
136
+ type: 'string',
137
+ description: 'Name for the new Task List',
138
+ },
139
+ description: {
140
+ type: 'string',
141
+ description: 'Optional description of the Task List',
142
+ },
143
+ },
144
+ required: ['board_id', 'project_id', 'name'],
145
+ },
146
+ annotations: {
147
+ title: 'Create task list',
148
+ readOnlyHint: false,
149
+ destructiveHint: false,
150
+ idempotentHint: false,
151
+ openWorldHint: true,
152
+ },
153
+ };
154
+ // --- Get Task List ---
155
+ const GetTaskListSchema = z.object({
156
+ task_list_id: z.string().describe('The ID of the Task List to retrieve'),
157
+ });
158
+ export async function getTaskList(client, args) {
159
+ try {
160
+ const params = GetTaskListSchema.parse(args);
161
+ const response = await client.getTaskList(params.task_list_id);
162
+ const taskList = response.data;
163
+ let text = `Task List: ${taskList.attributes.name} (ID: ${taskList.id})`;
164
+ if (taskList.attributes.position !== undefined) {
165
+ text += `\nPosition: ${taskList.attributes.position}`;
166
+ }
167
+ if (taskList.relationships?.board?.data?.id) {
168
+ text += `\nBoard ID: ${taskList.relationships.board.data.id}`;
169
+ }
170
+ return {
171
+ content: [
172
+ {
173
+ type: 'text',
174
+ text: text,
175
+ },
176
+ ],
177
+ };
178
+ }
179
+ catch (error) {
180
+ throw toMcpError(error);
181
+ }
182
+ }
183
+ export const getTaskListTool = {
184
+ name: 'get_task_list',
185
+ description: 'Get full details of one Task List by ID -- name, description, position, and its parent Board/Folder ID. This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself (use get_folder for those).',
186
+ inputSchema: {
187
+ type: 'object',
188
+ properties: {
189
+ task_list_id: {
190
+ type: 'string',
191
+ description: 'The ID of the Task List to retrieve',
192
+ },
193
+ },
194
+ required: ['task_list_id'],
195
+ },
196
+ annotations: { title: 'Get task list', readOnlyHint: true, openWorldHint: true },
197
+ };
198
+ export const getTaskListDefinition = getTaskListTool;
199
+ // --- Update Task List ---
200
+ const UpdateTaskListSchema = z.object({
201
+ task_list_id: z.string().describe('The ID of the Task List to update'),
202
+ name: z.string().optional().describe('New name for the Task List'),
203
+ });
204
+ export async function updateTaskList(client, args) {
205
+ try {
206
+ const params = UpdateTaskListSchema.parse(args);
207
+ const updateData = {
208
+ data: {
209
+ type: 'task_lists',
210
+ id: params.task_list_id,
211
+ attributes: {
212
+ ...(params.name && { name: params.name }),
213
+ },
214
+ },
215
+ };
216
+ const response = await client.updateTaskList(params.task_list_id, updateData);
217
+ const taskList = response.data;
218
+ let text = `Task list updated successfully!\n`;
219
+ text += `Name: ${taskList.attributes.name} (ID: ${taskList.id})`;
220
+ if (taskList.attributes.description) {
221
+ text += `\nDescription: ${taskList.attributes.description}`;
222
+ }
223
+ return {
224
+ content: [
225
+ {
226
+ type: 'text',
227
+ text: text,
228
+ },
229
+ ],
230
+ };
231
+ }
232
+ catch (error) {
233
+ throw toMcpError(error);
234
+ }
235
+ }
236
+ export const updateTaskListTool = {
237
+ name: 'update_task_list',
238
+ description: 'Rename an existing Task List by ID. This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself; use update_folder to rename a folder/board.',
239
+ inputSchema: {
240
+ type: 'object',
241
+ properties: {
242
+ task_list_id: {
243
+ type: 'string',
244
+ description: 'The ID of the Task List to update',
245
+ },
246
+ name: {
247
+ type: 'string',
248
+ description: 'New name for the Task List',
249
+ },
250
+ },
251
+ required: ['task_list_id'],
252
+ },
253
+ annotations: {
254
+ title: 'Update task list',
255
+ readOnlyHint: false,
256
+ destructiveHint: false,
257
+ idempotentHint: true,
258
+ openWorldHint: true,
259
+ },
260
+ };
261
+ export const updateTaskListDefinition = updateTaskListTool;
262
+ // --- Archive Task List ---
263
+ const ArchiveTaskListSchema = z.object({
264
+ task_list_id: z.string().describe('The ID of the Task List to archive'),
265
+ });
266
+ export async function archiveTaskList(client, args) {
267
+ try {
268
+ const params = ArchiveTaskListSchema.parse(args);
269
+ await client.archiveTaskList(params.task_list_id);
270
+ return {
271
+ content: [
272
+ {
273
+ type: 'text',
274
+ text: `Task list ${params.task_list_id} archived successfully.`,
275
+ },
276
+ ],
277
+ };
278
+ }
279
+ catch (error) {
280
+ throw toMcpError(error);
281
+ }
282
+ }
283
+ export const archiveTaskListTool = {
284
+ name: 'archive_task_list',
285
+ description: 'Archive a Task List by ID: hides it and its tasks from active board/folder views while preserving its data, so it can be brought back later with restore_task_list. This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself; use archive_folder to archive the whole folder/board.',
286
+ inputSchema: {
287
+ type: 'object',
288
+ properties: {
289
+ task_list_id: {
290
+ type: 'string',
291
+ description: 'The ID of the Task List to archive',
292
+ },
293
+ },
294
+ required: ['task_list_id'],
295
+ },
296
+ annotations: {
297
+ title: 'Archive task list',
298
+ readOnlyHint: false,
299
+ destructiveHint: true,
300
+ idempotentHint: true,
301
+ openWorldHint: true,
302
+ },
303
+ };
304
+ export const archiveTaskListDefinition = archiveTaskListTool;
305
+ // --- Restore Task List ---
306
+ const RestoreTaskListSchema = z.object({
307
+ task_list_id: z.string().describe('The ID of the archived Task List to restore'),
308
+ });
309
+ export async function restoreTaskList(client, args) {
310
+ try {
311
+ const params = RestoreTaskListSchema.parse(args);
312
+ await client.restoreTaskList(params.task_list_id);
313
+ return {
314
+ content: [
315
+ {
316
+ type: 'text',
317
+ text: `Task list ${params.task_list_id} restored successfully.`,
318
+ },
319
+ ],
320
+ };
321
+ }
322
+ catch (error) {
323
+ throw toMcpError(error);
324
+ }
325
+ }
326
+ export const restoreTaskListTool = {
327
+ name: 'restore_task_list',
328
+ description: 'Restore a previously archived Task List by ID, bringing it and its tasks back into active board/folder views (reverses archive_task_list). This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself; use restore_folder for those.',
329
+ inputSchema: {
330
+ type: 'object',
331
+ properties: {
332
+ task_list_id: {
333
+ type: 'string',
334
+ description: 'The ID of the archived Task List to restore',
335
+ },
336
+ },
337
+ required: ['task_list_id'],
338
+ },
339
+ annotations: {
340
+ title: 'Restore task list',
341
+ readOnlyHint: false,
342
+ destructiveHint: false,
343
+ idempotentHint: true,
344
+ openWorldHint: true,
345
+ },
346
+ };
347
+ export const restoreTaskListDefinition = restoreTaskListTool;
348
+ // --- Copy Task List ---
349
+ const CopyTaskListSchema = z.object({
350
+ name: z.string().describe('Name for the new (copied) Task List'),
351
+ template_id: z
352
+ .string()
353
+ .describe('The ID of the source Task List to copy from (used as a template)'),
354
+ project_id: z.string().describe('The ID of the project the new Task List will belong to'),
355
+ board_id: z.string().describe('The ID of the board/Folder the new Task List will be created in'),
356
+ copy_open_tasks: coerceBoolean
357
+ .optional()
358
+ .describe('Whether to also copy the open (incomplete) tasks from the template into the new list'),
359
+ copy_assignees: coerceBoolean
360
+ .optional()
361
+ .describe('Whether to preserve task assignees when copying tasks from the template'),
362
+ });
363
+ export async function copyTaskList(client, args) {
364
+ try {
365
+ const params = CopyTaskListSchema.parse(args);
366
+ const response = await client.copyTaskList({
367
+ name: params.name,
368
+ template_id: params.template_id,
369
+ project_id: params.project_id,
370
+ board_id: params.board_id,
371
+ ...(params.copy_open_tasks !== undefined && { copy_open_tasks: params.copy_open_tasks }),
372
+ ...(params.copy_assignees !== undefined && { copy_assignees: params.copy_assignees }),
373
+ });
374
+ const taskList = response.data;
375
+ let text = `Task list copied successfully!\n`;
376
+ text += `Name: ${taskList.attributes.name} (ID: ${taskList.id})`;
377
+ if (taskList.attributes.description) {
378
+ text += `\nDescription: ${taskList.attributes.description}`;
379
+ }
380
+ text += `\nBoard ID: ${params.board_id}`;
381
+ return {
382
+ content: [
383
+ {
384
+ type: 'text',
385
+ text: text,
386
+ },
387
+ ],
388
+ };
389
+ }
390
+ catch (error) {
391
+ throw toMcpError(error);
392
+ }
393
+ }
394
+ export const copyTaskListTool = {
395
+ name: 'copy_task_list',
396
+ description: 'Duplicate an existing Task List, used as a template, into a folder/board -- creating a new task list with the given name. This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself; use copy_folder to copy an entire folder/board.',
397
+ inputSchema: {
398
+ type: 'object',
399
+ properties: {
400
+ name: {
401
+ type: 'string',
402
+ description: 'Name for the new (copied) Task List',
403
+ },
404
+ template_id: {
405
+ type: 'string',
406
+ description: 'The ID of the source Task List to copy from (used as a template)',
407
+ },
408
+ project_id: {
409
+ type: 'string',
410
+ description: 'The ID of the project the new Task List will belong to',
411
+ },
412
+ board_id: {
413
+ type: 'string',
414
+ description: 'The ID of the board/Folder the new Task List will be created in',
415
+ },
416
+ copy_open_tasks: {
417
+ type: 'boolean',
418
+ description: 'Whether to also copy the open (incomplete) tasks from the template into the new list',
419
+ },
420
+ copy_assignees: {
421
+ type: 'boolean',
422
+ description: 'Whether to preserve task assignees when copying tasks from the template',
423
+ },
424
+ },
425
+ required: ['name', 'template_id', 'project_id', 'board_id'],
426
+ },
427
+ annotations: {
428
+ title: 'Copy task list',
429
+ readOnlyHint: false,
430
+ destructiveHint: false,
431
+ idempotentHint: false,
432
+ openWorldHint: true,
433
+ },
434
+ };
435
+ export const copyTaskListDefinition = copyTaskListTool;
436
+ // --- Move Task List ---
437
+ const MoveTaskListSchema = z.object({
438
+ task_list_id: z.string().describe('The ID of the Task List to move'),
439
+ board_id: z
440
+ .string()
441
+ .describe('The ID of the destination board/Folder to move the Task List into'),
442
+ });
443
+ export async function moveTaskList(client, args) {
444
+ try {
445
+ const params = MoveTaskListSchema.parse(args);
446
+ await client.moveTaskList(params.task_list_id, params.board_id);
447
+ return {
448
+ content: [
449
+ {
450
+ type: 'text',
451
+ text: `Task list ${params.task_list_id} moved to board ${params.board_id} successfully.`,
452
+ },
453
+ ],
454
+ };
455
+ }
456
+ catch (error) {
457
+ throw toMcpError(error);
458
+ }
459
+ }
460
+ export const moveTaskListTool = {
461
+ name: 'move_task_list',
462
+ description: 'Move a Task List, together with its tasks, to a different Folder/Board. This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself; use move_folder to move an entire folder/board between projects.',
463
+ inputSchema: {
464
+ type: 'object',
465
+ properties: {
466
+ task_list_id: {
467
+ type: 'string',
468
+ description: 'The ID of the Task List to move',
469
+ },
470
+ board_id: {
471
+ type: 'string',
472
+ description: 'The ID of the destination board/Folder to move the Task List into',
473
+ },
474
+ },
475
+ required: ['task_list_id', 'board_id'],
476
+ },
477
+ annotations: {
478
+ title: 'Move task list',
479
+ readOnlyHint: false,
480
+ destructiveHint: false,
481
+ idempotentHint: true,
482
+ openWorldHint: true,
483
+ },
484
+ };
485
+ export const moveTaskListDefinition = moveTaskListTool;
486
+ // --- Reposition Task List ---
487
+ const RepositionTaskListSchema = z.object({
488
+ task_list_id: z.string().describe('The ID of the Task List to reposition'),
489
+ move_before_id: z
490
+ .string()
491
+ .describe('The ID of the Task List to place this one immediately before'),
492
+ });
493
+ export async function repositionTaskList(client, args) {
494
+ try {
495
+ const params = RepositionTaskListSchema.parse(args);
496
+ await client.repositionTaskList(params.task_list_id, params.move_before_id);
497
+ return {
498
+ content: [
499
+ {
500
+ type: 'text',
501
+ text: `Task list ${params.task_list_id} repositioned before ${params.move_before_id} successfully.`,
502
+ },
503
+ ],
504
+ };
505
+ }
506
+ catch (error) {
507
+ throw toMcpError(error);
508
+ }
509
+ }
510
+ export const repositionTaskListTool = {
511
+ name: 'reposition_task_list',
512
+ description: 'Reorder a Task List within its Folder/Board by placing it immediately before another task list (changes display order only). This is a Task List, living inside a Folder/Board -- NOT the Folder/Board itself; use reposition_folder for those.',
513
+ inputSchema: {
514
+ type: 'object',
515
+ properties: {
516
+ task_list_id: {
517
+ type: 'string',
518
+ description: 'The ID of the Task List to reposition',
519
+ },
520
+ move_before_id: {
521
+ type: 'string',
522
+ description: 'The ID of the Task List to place this one immediately before',
523
+ },
524
+ },
525
+ required: ['task_list_id', 'move_before_id'],
526
+ },
527
+ annotations: {
528
+ title: 'Reposition task list',
529
+ readOnlyHint: false,
530
+ destructiveHint: false,
531
+ idempotentHint: true,
532
+ openWorldHint: true,
533
+ },
534
+ };
535
+ export const repositionTaskListDefinition = repositionTaskListTool;