@tenonhq/dovetail-mcp 0.0.54 → 0.0.55

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.
package/README.md CHANGED
@@ -50,7 +50,7 @@ clear "not configured" error.
50
50
  > with `gmail.readonly` + `calendar.readonly` scopes is recommended for
51
51
  > defence-in-depth and is tracked separately.
52
52
 
53
- ## Tools (16)
53
+ ## Tools (22)
54
54
 
55
55
  | Tool | Purpose |
56
56
  |---------------------------------|------------------------------------------------|
@@ -62,6 +62,12 @@ clear "not configured" error.
62
62
  | `clickup_set_custom_field` 🔒 | **Gated write** — set one custom-field value |
63
63
  | `clickup_create_task` 🔒 | **Gated write** — create a task in a list |
64
64
  | `clickup_link_tasks` 🔒 | **Gated write** — link two tasks |
65
+ | `clickup_get_goals` | Goals in a workspace with percent complete |
66
+ | `clickup_get_goal` | One Goal with its key results (read-back after writes) |
67
+ | `clickup_create_goal` 🔒 | **Gated write** — create a Goal (dueDate `YYYY-MM-DD`) |
68
+ | `clickup_update_goal` 🔒 | **Gated write** — rename / re-date / recolor / change owners |
69
+ | `clickup_create_key_result` 🔒 | **Gated write** — add a key result (number/currency/boolean/percentage/automatic; integer steps) |
70
+ | `clickup_edit_key_result` 🔒 | **Gated write** — set `stepsCurrent` + required progress note |
65
71
  | `gmail_get_unread` | Unread inbox emails |
66
72
  | `gmail_get_starred` | Starred emails |
67
73
  | `gmail_search` | Gmail query syntax |
@@ -177,7 +183,10 @@ which may use only the ClickUp write functions. Every other tool module stays
177
183
  read-only. Three layers enforce this:
178
184
 
179
185
  1. **Imports.** Read tool modules import only read functions; the write module
180
- imports only `createTask` / `updateTask` / `setCustomField` / `linkTask`.
186
+ imports only `createTask` / `updateTask` / `setCustomField` / `linkTask` /
187
+ `createGoal` / `updateGoal` / `createKeyResult` / `editKeyResult`.
188
+ `deleteGoal` / `deleteKeyResult` exist in `dovetail-clickup` but are banned
189
+ everywhere in this package, the write module included.
181
190
  2. **ESLint** (`.eslintrc.json` `no-restricted-imports`) blocks write imports
182
191
  from `dovetail-clickup` / `dovetail-gmail` / `dovetail-google-calendar` /
183
192
  `dovetail-servicenow`, with a scoped `overrides` entry that permits the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Tool registration glue. Exports TOOL_NAMES (the canonical 12-tuple) and
2
+ * Tool registration glue. Exports TOOL_NAMES (the canonical tool tuple) and
3
3
  * registerAllTools(), which wires every handler with telemetry + JSON
4
4
  * serialization for MCP transport.
5
5
  *
@@ -20,7 +20,7 @@ import type { ClickUpDeps } from "./tools/clickup";
20
20
  import type { GmailDeps } from "./tools/gmail";
21
21
  import type { CalendarDeps } from "./tools/calendar";
22
22
  import type { ServiceNowDeps } from "./tools/servicenow";
23
- export declare var TOOL_NAMES: readonly ["clickup_list_tasks", "clickup_get_task", "clickup_search_tasks", "clickup_get_team_sync", "clickup_update_task", "clickup_set_custom_field", "clickup_create_task", "clickup_link_tasks", "gmail_get_unread", "gmail_get_starred", "gmail_search", "gmail_get_action_required", "calendar_get_today", "calendar_get_week", "calendar_get_event", "servicenow_query_table"];
23
+ export declare var TOOL_NAMES: readonly ["clickup_list_tasks", "clickup_get_task", "clickup_search_tasks", "clickup_get_team_sync", "clickup_update_task", "clickup_set_custom_field", "clickup_create_task", "clickup_link_tasks", "clickup_get_goals", "clickup_get_goal", "clickup_create_goal", "clickup_update_goal", "clickup_create_key_result", "clickup_edit_key_result", "gmail_get_unread", "gmail_get_starred", "gmail_search", "gmail_get_action_required", "calendar_get_today", "calendar_get_week", "calendar_get_event", "servicenow_query_table"];
24
24
  export type ToolName = typeof TOOL_NAMES[number];
25
25
  export interface RegistryDeps {
26
26
  clickup?: ClickUpDeps;
package/dist/registry.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
- * Tool registration glue. Exports TOOL_NAMES (the canonical 12-tuple) and
3
+ * Tool registration glue. Exports TOOL_NAMES (the canonical tool tuple) and
4
4
  * registerAllTools(), which wires every handler with telemetry + JSON
5
5
  * serialization for MCP transport.
6
6
  *
@@ -37,6 +37,12 @@ exports.TOOL_NAMES = [
37
37
  "clickup_set_custom_field",
38
38
  "clickup_create_task",
39
39
  "clickup_link_tasks",
40
+ "clickup_get_goals",
41
+ "clickup_get_goal",
42
+ "clickup_create_goal",
43
+ "clickup_update_goal",
44
+ "clickup_create_key_result",
45
+ "clickup_edit_key_result",
40
46
  "gmail_get_unread",
41
47
  "gmail_get_starred",
42
48
  "gmail_search",
@@ -126,6 +132,60 @@ function buildDescriptors(deps) {
126
132
  return (0, clickup_write_1.clickupLinkTasks)(args, deps.clickup);
127
133
  })
128
134
  },
135
+ {
136
+ name: "clickup_get_goals",
137
+ description: "List the ClickUp Goals in a workspace with percent complete (no key results — use clickup_get_goal). teamId optional if CLICKUP_TEAM_ID is set.",
138
+ shape: clickup_1.clickupGetGoalsSchema.shape,
139
+ annotations: dovetail_mcp_kit_1.READ_ONLY,
140
+ handler: requireConfig(clickupReady, "ClickUp", deps.missingDescription, function (args) {
141
+ return (0, clickup_2.clickupGetGoals)(args, deps.clickup);
142
+ })
143
+ },
144
+ {
145
+ name: "clickup_get_goal",
146
+ description: "Fetch one ClickUp Goal with its key results (steps_start/end/current, last action). Use it to read back after any goal or key-result write.",
147
+ shape: clickup_1.clickupGetGoalSchema.shape,
148
+ annotations: dovetail_mcp_kit_1.READ_ONLY,
149
+ handler: requireConfig(clickupReady, "ClickUp", deps.missingDescription, function (args) {
150
+ return (0, clickup_2.clickupGetGoal)(args, deps.clickup);
151
+ })
152
+ },
153
+ {
154
+ name: "clickup_create_goal",
155
+ description: "Gated write: create a ClickUp Goal (name, dueDate YYYY-MM-DD, description, owners, color). teamId optional if CLICKUP_TEAM_ID is set. Requires SINC_MCP_WRITES_ENABLE=1; dry-run unless confirm:true.",
156
+ shape: clickup_1.clickupCreateGoalSchema.shape,
157
+ annotations: dovetail_mcp_kit_1.WRITE_CREATE,
158
+ handler: requireConfig(clickupReady, "ClickUp", deps.missingDescription, function (args) {
159
+ return (0, clickup_write_1.clickupCreateGoal)(args, deps.clickup);
160
+ })
161
+ },
162
+ {
163
+ name: "clickup_update_goal",
164
+ description: "Gated write: update a ClickUp Goal's name, dueDate, description, color, or owners (addOwners/remOwners). Requires SINC_MCP_WRITES_ENABLE=1; dry-run unless confirm:true.",
165
+ shape: clickup_1.clickupUpdateGoalSchema.shape,
166
+ annotations: dovetail_mcp_kit_1.WRITE_OVERWRITE,
167
+ handler: requireConfig(clickupReady, "ClickUp", deps.missingDescription, function (args) {
168
+ return (0, clickup_write_1.clickupUpdateGoal)(args, deps.clickup);
169
+ })
170
+ },
171
+ {
172
+ name: "clickup_create_key_result",
173
+ description: "Gated write: add a key result (Target) to a Goal. type: number | currency | boolean | percentage | automatic. Steps are integers (pick a finer unit for precision); boolean is always 0→1; automatic needs taskIds or listIds. Requires SINC_MCP_WRITES_ENABLE=1; dry-run unless confirm:true.",
174
+ shape: clickup_1.clickupCreateKeyResultSchema.shape,
175
+ annotations: dovetail_mcp_kit_1.WRITE_CREATE,
176
+ handler: requireConfig(clickupReady, "ClickUp", deps.missingDescription, function (args) {
177
+ return (0, clickup_write_1.clickupCreateKeyResult)(args, deps.clickup);
178
+ })
179
+ },
180
+ {
181
+ name: "clickup_edit_key_result",
182
+ description: "Gated write: record progress on a key result — sets stepsCurrent (integer) and logs a required note; put the period and the evidence link in the note. Read back with clickup_get_goal. Requires SINC_MCP_WRITES_ENABLE=1; dry-run unless confirm:true.",
183
+ shape: clickup_1.clickupEditKeyResultSchema.shape,
184
+ annotations: dovetail_mcp_kit_1.WRITE_OVERWRITE,
185
+ handler: requireConfig(clickupReady, "ClickUp", deps.missingDescription, function (args) {
186
+ return (0, clickup_write_1.clickupEditKeyResult)(args, deps.clickup);
187
+ })
188
+ },
129
189
  {
130
190
  name: "gmail_get_unread",
131
191
  description: "Fetch unread emails from the inbox.",
@@ -165,3 +165,129 @@ export type ClickupUpdateTaskInput = z.infer<typeof clickupUpdateTaskSchema>;
165
165
  export type ClickupSetCustomFieldInput = z.infer<typeof clickupSetCustomFieldSchema>;
166
166
  export type ClickupCreateTaskInput = z.infer<typeof clickupCreateTaskSchema>;
167
167
  export type ClickupLinkTasksInput = z.infer<typeof clickupLinkTasksSchema>;
168
+ export declare var clickupGetGoalsSchema: z.ZodObject<{
169
+ teamId: z.ZodOptional<z.ZodString>;
170
+ includeCompleted: z.ZodOptional<z.ZodBoolean>;
171
+ }, "strict", z.ZodTypeAny, {
172
+ teamId?: string | undefined;
173
+ includeCompleted?: boolean | undefined;
174
+ }, {
175
+ teamId?: string | undefined;
176
+ includeCompleted?: boolean | undefined;
177
+ }>;
178
+ export declare var clickupGetGoalSchema: z.ZodObject<{
179
+ goalId: z.ZodString;
180
+ }, "strict", z.ZodTypeAny, {
181
+ goalId: string;
182
+ }, {
183
+ goalId: string;
184
+ }>;
185
+ export declare var clickupCreateGoalSchema: z.ZodObject<{
186
+ name: z.ZodString;
187
+ dueDate: z.ZodString;
188
+ description: z.ZodOptional<z.ZodString>;
189
+ owners: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
190
+ color: z.ZodOptional<z.ZodString>;
191
+ teamId: z.ZodOptional<z.ZodString>;
192
+ confirm: z.ZodOptional<z.ZodBoolean>;
193
+ }, "strict", z.ZodTypeAny, {
194
+ name: string;
195
+ dueDate: string;
196
+ color?: string | undefined;
197
+ description?: string | undefined;
198
+ confirm?: boolean | undefined;
199
+ teamId?: string | undefined;
200
+ owners?: number[] | undefined;
201
+ }, {
202
+ name: string;
203
+ dueDate: string;
204
+ color?: string | undefined;
205
+ description?: string | undefined;
206
+ confirm?: boolean | undefined;
207
+ teamId?: string | undefined;
208
+ owners?: number[] | undefined;
209
+ }>;
210
+ export declare var clickupUpdateGoalSchema: z.ZodObject<{
211
+ goalId: z.ZodString;
212
+ name: z.ZodOptional<z.ZodString>;
213
+ dueDate: z.ZodOptional<z.ZodString>;
214
+ description: z.ZodOptional<z.ZodString>;
215
+ addOwners: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
216
+ remOwners: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
217
+ color: z.ZodOptional<z.ZodString>;
218
+ confirm: z.ZodOptional<z.ZodBoolean>;
219
+ }, "strict", z.ZodTypeAny, {
220
+ goalId: string;
221
+ name?: string | undefined;
222
+ color?: string | undefined;
223
+ description?: string | undefined;
224
+ confirm?: boolean | undefined;
225
+ dueDate?: string | undefined;
226
+ addOwners?: number[] | undefined;
227
+ remOwners?: number[] | undefined;
228
+ }, {
229
+ goalId: string;
230
+ name?: string | undefined;
231
+ color?: string | undefined;
232
+ description?: string | undefined;
233
+ confirm?: boolean | undefined;
234
+ dueDate?: string | undefined;
235
+ addOwners?: number[] | undefined;
236
+ remOwners?: number[] | undefined;
237
+ }>;
238
+ export declare var clickupCreateKeyResultSchema: z.ZodObject<{
239
+ goalId: z.ZodString;
240
+ name: z.ZodString;
241
+ type: z.ZodEnum<["number", "currency", "boolean", "percentage", "automatic"]>;
242
+ stepsStart: z.ZodNumber;
243
+ stepsEnd: z.ZodNumber;
244
+ unit: z.ZodOptional<z.ZodString>;
245
+ owners: z.ZodOptional<z.ZodArray<z.ZodNumber, "many">>;
246
+ taskIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
247
+ listIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
248
+ confirm: z.ZodOptional<z.ZodBoolean>;
249
+ }, "strict", z.ZodTypeAny, {
250
+ name: string;
251
+ type: "number" | "boolean" | "currency" | "percentage" | "automatic";
252
+ goalId: string;
253
+ stepsStart: number;
254
+ stepsEnd: number;
255
+ unit?: string | undefined;
256
+ confirm?: boolean | undefined;
257
+ owners?: number[] | undefined;
258
+ taskIds?: string[] | undefined;
259
+ listIds?: string[] | undefined;
260
+ }, {
261
+ name: string;
262
+ type: "number" | "boolean" | "currency" | "percentage" | "automatic";
263
+ goalId: string;
264
+ stepsStart: number;
265
+ stepsEnd: number;
266
+ unit?: string | undefined;
267
+ confirm?: boolean | undefined;
268
+ owners?: number[] | undefined;
269
+ taskIds?: string[] | undefined;
270
+ listIds?: string[] | undefined;
271
+ }>;
272
+ export declare var clickupEditKeyResultSchema: z.ZodObject<{
273
+ keyResultId: z.ZodString;
274
+ stepsCurrent: z.ZodNumber;
275
+ note: z.ZodString;
276
+ confirm: z.ZodOptional<z.ZodBoolean>;
277
+ }, "strict", z.ZodTypeAny, {
278
+ keyResultId: string;
279
+ stepsCurrent: number;
280
+ note: string;
281
+ confirm?: boolean | undefined;
282
+ }, {
283
+ keyResultId: string;
284
+ stepsCurrent: number;
285
+ note: string;
286
+ confirm?: boolean | undefined;
287
+ }>;
288
+ export type ClickupGetGoalsInput = z.infer<typeof clickupGetGoalsSchema>;
289
+ export type ClickupGetGoalInput = z.infer<typeof clickupGetGoalSchema>;
290
+ export type ClickupCreateGoalInput = z.infer<typeof clickupCreateGoalSchema>;
291
+ export type ClickupUpdateGoalInput = z.infer<typeof clickupUpdateGoalSchema>;
292
+ export type ClickupCreateKeyResultInput = z.infer<typeof clickupCreateKeyResultSchema>;
293
+ export type ClickupEditKeyResultInput = z.infer<typeof clickupEditKeyResultSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clickupLinkTasksSchema = exports.clickupCreateTaskSchema = exports.clickupSetCustomFieldSchema = exports.clickupUpdateTaskSchema = exports.clickupGetTeamSyncSchema = exports.clickupSearchTasksSchema = exports.clickupGetTaskSchema = exports.clickupListTasksSchema = void 0;
3
+ exports.clickupEditKeyResultSchema = exports.clickupCreateKeyResultSchema = exports.clickupUpdateGoalSchema = exports.clickupCreateGoalSchema = exports.clickupGetGoalSchema = exports.clickupGetGoalsSchema = exports.clickupLinkTasksSchema = exports.clickupCreateTaskSchema = exports.clickupSetCustomFieldSchema = exports.clickupUpdateTaskSchema = exports.clickupGetTeamSyncSchema = exports.clickupSearchTasksSchema = exports.clickupGetTaskSchema = exports.clickupListTasksSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.clickupListTasksSchema = zod_1.z.object({
6
6
  teamId: zod_1.z.string().min(1).optional(),
@@ -66,3 +66,56 @@ exports.clickupLinkTasksSchema = zod_1.z.object({
66
66
  teamId: zod_1.z.string().min(1).optional(),
67
67
  confirm: zod_1.z.boolean().optional()
68
68
  }).strict();
69
+ // --- Goals + Key Results ---
70
+ // Goal and key-result ids are UUIDs. Key-result steps are integers — the ClickUp
71
+ // v2 API rejects fractional values, so callers needing precision pick a finer
72
+ // unit (hours, not days). Cross-field rules (boolean 0→1, automatic needs
73
+ // taskIds/listIds, start ≠ end) are enforced in clickup-write.ts.
74
+ var goalIdSchema = zod_1.z.string().min(1);
75
+ var dueDateSchema = zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "dueDate must be YYYY-MM-DD");
76
+ var colorSchema = zod_1.z.string().regex(/^#[0-9A-Fa-f]{6}$/, "color must be #RRGGBB");
77
+ var userIdsSchema = zod_1.z.array(zod_1.z.number().int().positive());
78
+ exports.clickupGetGoalsSchema = zod_1.z.object({
79
+ teamId: zod_1.z.string().min(1).optional(),
80
+ includeCompleted: zod_1.z.boolean().optional()
81
+ }).strict();
82
+ exports.clickupGetGoalSchema = zod_1.z.object({
83
+ goalId: goalIdSchema
84
+ }).strict();
85
+ exports.clickupCreateGoalSchema = zod_1.z.object({
86
+ name: zod_1.z.string().min(1),
87
+ dueDate: dueDateSchema,
88
+ description: zod_1.z.string().optional(),
89
+ owners: userIdsSchema.optional(),
90
+ color: colorSchema.optional(),
91
+ teamId: zod_1.z.string().min(1).optional(),
92
+ confirm: zod_1.z.boolean().optional()
93
+ }).strict();
94
+ exports.clickupUpdateGoalSchema = zod_1.z.object({
95
+ goalId: goalIdSchema,
96
+ name: zod_1.z.string().min(1).optional(),
97
+ dueDate: dueDateSchema.optional(),
98
+ description: zod_1.z.string().optional(),
99
+ addOwners: userIdsSchema.optional(),
100
+ remOwners: userIdsSchema.optional(),
101
+ color: colorSchema.optional(),
102
+ confirm: zod_1.z.boolean().optional()
103
+ }).strict();
104
+ exports.clickupCreateKeyResultSchema = zod_1.z.object({
105
+ goalId: goalIdSchema,
106
+ name: zod_1.z.string().min(1),
107
+ type: zod_1.z.enum(["number", "currency", "boolean", "percentage", "automatic"]),
108
+ stepsStart: zod_1.z.number().int(),
109
+ stepsEnd: zod_1.z.number().int(),
110
+ unit: zod_1.z.string().optional(),
111
+ owners: userIdsSchema.optional(),
112
+ taskIds: zod_1.z.array(zod_1.z.string().min(1)).optional(),
113
+ listIds: zod_1.z.array(zod_1.z.string().min(1)).optional(),
114
+ confirm: zod_1.z.boolean().optional()
115
+ }).strict();
116
+ exports.clickupEditKeyResultSchema = zod_1.z.object({
117
+ keyResultId: zod_1.z.string().min(1),
118
+ stepsCurrent: zod_1.z.number().int(),
119
+ note: zod_1.z.string().trim().min(1, "note is required (period + evidence link)"),
120
+ confirm: zod_1.z.boolean().optional()
121
+ }).strict();
@@ -12,9 +12,21 @@
12
12
  * The calling agent can set confirm itself — this is a preview/speed-bump,
13
13
  * NOT a human-in-the-loop checkpoint.
14
14
  */
15
+ import type { ClickUpGoal, ClickUpKeyResult } from "@tenonhq/dovetail-clickup";
15
16
  import { ClickUpDeps } from "./clickup";
16
- import { ClickupUpdateTaskInput, ClickupSetCustomFieldInput, ClickupCreateTaskInput, ClickupLinkTasksInput } from "../schemas/clickup";
17
+ import { ClickupUpdateTaskInput, ClickupSetCustomFieldInput, ClickupCreateTaskInput, ClickupLinkTasksInput, ClickupCreateGoalInput, ClickupUpdateGoalInput, ClickupCreateKeyResultInput, ClickupEditKeyResultInput } from "../schemas/clickup";
17
18
  export declare function clickupUpdateTask(args: ClickupUpdateTaskInput, deps: ClickUpDeps): Promise<any>;
18
19
  export declare function clickupSetCustomField(args: ClickupSetCustomFieldInput, deps: ClickUpDeps): Promise<any>;
19
20
  export declare function clickupCreateTask(args: ClickupCreateTaskInput, deps: ClickUpDeps): Promise<any>;
20
21
  export declare function clickupLinkTasks(args: ClickupLinkTasksInput, deps: ClickUpDeps): Promise<any>;
22
+ interface DryRunPreview {
23
+ dryRun: true;
24
+ action: string;
25
+ note: string;
26
+ [key: string]: unknown;
27
+ }
28
+ export declare function clickupCreateGoal(args: ClickupCreateGoalInput, deps: ClickUpDeps): Promise<ClickUpGoal | DryRunPreview>;
29
+ export declare function clickupUpdateGoal(args: ClickupUpdateGoalInput, deps: ClickUpDeps): Promise<ClickUpGoal | DryRunPreview>;
30
+ export declare function clickupCreateKeyResult(args: ClickupCreateKeyResultInput, deps: ClickUpDeps): Promise<ClickUpKeyResult | DryRunPreview>;
31
+ export declare function clickupEditKeyResult(args: ClickupEditKeyResultInput, deps: ClickUpDeps): Promise<ClickUpKeyResult | DryRunPreview>;
32
+ export {};
@@ -18,6 +18,10 @@ exports.clickupUpdateTask = clickupUpdateTask;
18
18
  exports.clickupSetCustomField = clickupSetCustomField;
19
19
  exports.clickupCreateTask = clickupCreateTask;
20
20
  exports.clickupLinkTasks = clickupLinkTasks;
21
+ exports.clickupCreateGoal = clickupCreateGoal;
22
+ exports.clickupUpdateGoal = clickupUpdateGoal;
23
+ exports.clickupCreateKeyResult = clickupCreateKeyResult;
24
+ exports.clickupEditKeyResult = clickupEditKeyResult;
21
25
  const dovetail_clickup_1 = require("@tenonhq/dovetail-clickup");
22
26
  const clickup_1 = require("./clickup");
23
27
  function ensureWritesEnabled(deps) {
@@ -147,3 +151,154 @@ async function clickupLinkTasks(args, deps) {
147
151
  });
148
152
  return { ok: true, action: "link_tasks", taskId: args.taskId, linksTo: args.linksTo };
149
153
  }
154
+ // "YYYY-MM-DD" → epoch ms at the end of that day (UTC), the shape ClickUp wants.
155
+ // Date.parse rolls impossible days over (2026-02-30 → 2026-03-02), so the parsed
156
+ // date must round-trip to the same calendar day.
157
+ function toDueDateMs(dueDate) {
158
+ var ms = Date.parse(dueDate + "T23:59:59Z");
159
+ if (isNaN(ms) || new Date(ms).toISOString().slice(0, 10) !== dueDate) {
160
+ throw new Error("dueDate '" + dueDate + "' is not a real calendar date.");
161
+ }
162
+ return ms;
163
+ }
164
+ /**
165
+ * Cross-field rules for a key result, enforced here because the MCP SDK
166
+ * consumes the raw schema shape (no zod refinements). Returns the steps to send.
167
+ */
168
+ function resolveKeyResultSteps(args) {
169
+ if (args.type === "boolean") {
170
+ // A boolean target is done/not-done: ClickUp models it as 0 → 1.
171
+ return { start: 0, end: 1 };
172
+ }
173
+ if (args.type === "automatic") {
174
+ var hasTasks = !!args.taskIds && args.taskIds.length > 0;
175
+ var hasLists = !!args.listIds && args.listIds.length > 0;
176
+ if (!hasTasks && !hasLists) {
177
+ throw new Error("An automatic key result needs at least one taskIds or listIds entry.");
178
+ }
179
+ }
180
+ if (args.stepsStart === args.stepsEnd) {
181
+ throw new Error("stepsStart and stepsEnd must differ (a key result needs a range to progress through).");
182
+ }
183
+ return { start: args.stepsStart, end: args.stepsEnd };
184
+ }
185
+ async function clickupCreateGoal(args, deps) {
186
+ ensureWritesEnabled(deps);
187
+ var teamId = (0, clickup_1.requireTeamId)(deps, args.teamId);
188
+ var dueDateMs = toDueDateMs(args.dueDate);
189
+ if (!args.confirm) {
190
+ return {
191
+ dryRun: true,
192
+ action: "create_goal",
193
+ teamId: teamId,
194
+ name: args.name,
195
+ fields: {
196
+ dueDate: args.dueDate,
197
+ description: args.description,
198
+ owners: args.owners,
199
+ color: args.color
200
+ },
201
+ note: DRY_RUN_NOTE
202
+ };
203
+ }
204
+ var client = (0, clickup_1.resolveClient)(deps);
205
+ return await (0, dovetail_clickup_1.createGoal)({
206
+ client: client,
207
+ teamId: teamId,
208
+ name: args.name,
209
+ dueDate: dueDateMs,
210
+ description: args.description,
211
+ owners: args.owners,
212
+ color: args.color
213
+ });
214
+ }
215
+ async function clickupUpdateGoal(args, deps) {
216
+ ensureWritesEnabled(deps);
217
+ var dueDateMs = args.dueDate !== undefined ? toDueDateMs(args.dueDate) : undefined;
218
+ if (!args.confirm) {
219
+ return {
220
+ dryRun: true,
221
+ action: "update_goal",
222
+ goalId: args.goalId,
223
+ changes: {
224
+ name: args.name,
225
+ dueDate: args.dueDate,
226
+ description: args.description,
227
+ addOwners: args.addOwners,
228
+ remOwners: args.remOwners,
229
+ color: args.color
230
+ },
231
+ note: DRY_RUN_NOTE
232
+ };
233
+ }
234
+ var client = (0, clickup_1.resolveClient)(deps);
235
+ return await (0, dovetail_clickup_1.updateGoal)({
236
+ client: client,
237
+ goalId: args.goalId,
238
+ name: args.name,
239
+ dueDate: dueDateMs,
240
+ description: args.description,
241
+ addOwners: args.addOwners,
242
+ remOwners: args.remOwners,
243
+ color: args.color
244
+ });
245
+ }
246
+ async function clickupCreateKeyResult(args, deps) {
247
+ ensureWritesEnabled(deps);
248
+ var steps = resolveKeyResultSteps(args);
249
+ if (!args.confirm) {
250
+ return {
251
+ dryRun: true,
252
+ action: "create_key_result",
253
+ goalId: args.goalId,
254
+ name: args.name,
255
+ fields: {
256
+ type: args.type,
257
+ stepsStart: steps.start,
258
+ stepsEnd: steps.end,
259
+ unit: args.unit,
260
+ owners: args.owners,
261
+ taskIds: args.taskIds,
262
+ listIds: args.listIds
263
+ },
264
+ note: DRY_RUN_NOTE
265
+ };
266
+ }
267
+ var client = (0, clickup_1.resolveClient)(deps);
268
+ return await (0, dovetail_clickup_1.createKeyResult)({
269
+ client: client,
270
+ goalId: args.goalId,
271
+ name: args.name,
272
+ type: args.type,
273
+ stepsStart: steps.start,
274
+ stepsEnd: steps.end,
275
+ unit: args.unit,
276
+ owners: args.owners,
277
+ taskIds: args.taskIds,
278
+ listIds: args.listIds
279
+ });
280
+ }
281
+ async function clickupEditKeyResult(args, deps) {
282
+ ensureWritesEnabled(deps);
283
+ var note = args.note.trim();
284
+ if (!note) {
285
+ throw new Error("note is required — record the period and the evidence link.");
286
+ }
287
+ if (!args.confirm) {
288
+ return {
289
+ dryRun: true,
290
+ action: "edit_key_result",
291
+ keyResultId: args.keyResultId,
292
+ stepsCurrent: args.stepsCurrent,
293
+ progressNote: note,
294
+ note: DRY_RUN_NOTE
295
+ };
296
+ }
297
+ var client = (0, clickup_1.resolveClient)(deps);
298
+ return await (0, dovetail_clickup_1.editKeyResult)({
299
+ client: client,
300
+ keyResultId: args.keyResultId,
301
+ stepsCurrent: args.stepsCurrent,
302
+ note: note
303
+ });
304
+ }
@@ -6,8 +6,9 @@
6
6
  * (.eslintrc.json) and asserted absent by tests/readonly-imports.test.ts.
7
7
  */
8
8
  import type { AxiosInstance } from "axios";
9
+ import type { ClickUpGoal } from "@tenonhq/dovetail-clickup";
9
10
  import type { ClickUpConfig } from "../config";
10
- import { ClickupListTasksInput, ClickupGetTaskInput, ClickupSearchTasksInput, ClickupGetTeamSyncInput } from "../schemas/clickup";
11
+ import { ClickupListTasksInput, ClickupGetTaskInput, ClickupSearchTasksInput, ClickupGetTeamSyncInput, ClickupGetGoalsInput, ClickupGetGoalInput } from "../schemas/clickup";
11
12
  import { TeamSyncJson } from "./teamsync";
12
13
  export interface ClickUpDeps {
13
14
  config: ClickUpConfig;
@@ -15,6 +16,7 @@ export interface ClickUpDeps {
15
16
  writesEnabled?: boolean;
16
17
  }
17
18
  export declare function resolveClient(deps: ClickUpDeps): AxiosInstance;
19
+ export declare function requireTeamId(deps: ClickUpDeps, override?: string): string;
18
20
  export declare function clickupListTasks(args: ClickupListTasksInput, deps: ClickUpDeps): Promise<{
19
21
  tasks: any[];
20
22
  byStatus: Record<string, any[]>;
@@ -27,3 +29,8 @@ export declare function clickupSearchTasks(args: ClickupSearchTasksInput, deps:
27
29
  query: string;
28
30
  }>;
29
31
  export declare function clickupGetTeamSync(args: ClickupGetTeamSyncInput, deps: ClickUpDeps): Promise<TeamSyncJson>;
32
+ export declare function clickupGetGoals(args: ClickupGetGoalsInput, deps: ClickUpDeps): Promise<{
33
+ goals: ClickUpGoal[];
34
+ total: number;
35
+ }>;
36
+ export declare function clickupGetGoal(args: ClickupGetGoalInput, deps: ClickUpDeps): Promise<ClickUpGoal>;
@@ -8,10 +8,13 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.resolveClient = resolveClient;
11
+ exports.requireTeamId = requireTeamId;
11
12
  exports.clickupListTasks = clickupListTasks;
12
13
  exports.clickupGetTask = clickupGetTask;
13
14
  exports.clickupSearchTasks = clickupSearchTasks;
14
15
  exports.clickupGetTeamSync = clickupGetTeamSync;
16
+ exports.clickupGetGoals = clickupGetGoals;
17
+ exports.clickupGetGoal = clickupGetGoal;
15
18
  const dovetail_clickup_1 = require("@tenonhq/dovetail-clickup");
16
19
  const teamsync_1 = require("./teamsync");
17
20
  function resolveClient(deps) {
@@ -90,3 +93,17 @@ async function clickupGetTeamSync(args, deps) {
90
93
  var teamId = requireTeamId(deps, args.teamId);
91
94
  return await (0, teamsync_1.buildTeamSyncJson)({ client: client, teamId: teamId });
92
95
  }
96
+ async function clickupGetGoals(args, deps) {
97
+ var client = resolveClient(deps);
98
+ var teamId = requireTeamId(deps, args.teamId);
99
+ var goals = await (0, dovetail_clickup_1.getGoals)({
100
+ client: client,
101
+ teamId: teamId,
102
+ includeCompleted: args.includeCompleted
103
+ });
104
+ return { goals: goals, total: goals.length };
105
+ }
106
+ async function clickupGetGoal(args, deps) {
107
+ var client = resolveClient(deps);
108
+ return await (0, dovetail_clickup_1.getGoal)({ client: client, goalId: args.goalId });
109
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenonhq/dovetail-mcp",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "MCP server exposing read tools for ClickUp / Gmail / Calendar / ServiceNow plus gated ClickUp writes, backed by the Dovetail integration packages.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -17,7 +17,7 @@
17
17
  "license": "GPL-3.0",
18
18
  "dependencies": {
19
19
  "@modelcontextprotocol/sdk": "^1.32.1",
20
- "@tenonhq/dovetail-clickup": "~0.0.14",
20
+ "@tenonhq/dovetail-clickup": "~0.0.15",
21
21
  "@tenonhq/dovetail-gmail": "~0.0.13",
22
22
  "@tenonhq/dovetail-google-auth": "~0.0.12",
23
23
  "@tenonhq/dovetail-google-calendar": "~0.0.11",