teamflect-mcp-server 1.0.3
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/.env.example +9 -0
- package/README.md +177 -0
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/dist/services/apiClient.d.ts +29 -0
- package/dist/services/apiClient.d.ts.map +1 -0
- package/dist/services/apiClient.js +92 -0
- package/dist/services/apiClient.js.map +1 -0
- package/dist/services/errorHandler.d.ts +5 -0
- package/dist/services/errorHandler.d.ts.map +1 -0
- package/dist/services/errorHandler.js +93 -0
- package/dist/services/errorHandler.js.map +1 -0
- package/dist/tools/feedbacks.d.ts +7 -0
- package/dist/tools/feedbacks.d.ts.map +1 -0
- package/dist/tools/feedbacks.js +372 -0
- package/dist/tools/feedbacks.js.map +1 -0
- package/dist/tools/goals.d.ts +7 -0
- package/dist/tools/goals.d.ts.map +1 -0
- package/dist/tools/goals.js +466 -0
- package/dist/tools/goals.js.map +1 -0
- package/dist/tools/recognitions.d.ts +7 -0
- package/dist/tools/recognitions.d.ts.map +1 -0
- package/dist/tools/recognitions.js +314 -0
- package/dist/tools/recognitions.js.map +1 -0
- package/dist/tools/reviews.d.ts +7 -0
- package/dist/tools/reviews.d.ts.map +1 -0
- package/dist/tools/reviews.js +224 -0
- package/dist/tools/reviews.js.map +1 -0
- package/dist/tools/tasks.d.ts +7 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +262 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/users.d.ts +7 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +417 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/types.d.ts +284 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../services/errorHandler.js";
|
|
3
|
+
import { ResponseFormat } from "../types.js";
|
|
4
|
+
import { DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE, CHARACTER_LIMIT } from "../constants.js";
|
|
5
|
+
/**
|
|
6
|
+
* Register recognition-related tools
|
|
7
|
+
*/
|
|
8
|
+
export function registerRecognitionTools(server, apiClient) {
|
|
9
|
+
// Get Recognition Schema
|
|
10
|
+
const GetRecognitionInputSchema = z.object({
|
|
11
|
+
recognitionId: z.string().min(1).describe("The ID of the recognition to retrieve"),
|
|
12
|
+
response_format: z.nativeEnum(ResponseFormat).default(ResponseFormat.MARKDOWN)
|
|
13
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable"),
|
|
14
|
+
}).strict();
|
|
15
|
+
server.registerTool("teamflect_get_recognition", {
|
|
16
|
+
title: "Get Recognition by ID",
|
|
17
|
+
description: `Retrieve a single recognition by its ID from Teamflect.
|
|
18
|
+
|
|
19
|
+
This tool fetches detailed information about a specific recognition including its badge, recipients, and description.
|
|
20
|
+
|
|
21
|
+
Args:
|
|
22
|
+
- recognitionId (string, required): The unique identifier of the recognition
|
|
23
|
+
- response_format ('markdown' | 'json', optional): Output format (default: 'markdown')
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
Complete recognition details including badge information and recipients.
|
|
27
|
+
|
|
28
|
+
Error Handling:
|
|
29
|
+
- Returns "Error: Resource not found" if recognitionId doesn't exist
|
|
30
|
+
- Returns "Error: Authentication failed" if API key is invalid`,
|
|
31
|
+
inputSchema: GetRecognitionInputSchema,
|
|
32
|
+
annotations: {
|
|
33
|
+
readOnlyHint: true,
|
|
34
|
+
destructiveHint: false,
|
|
35
|
+
idempotentHint: true,
|
|
36
|
+
openWorldHint: true,
|
|
37
|
+
},
|
|
38
|
+
}, async (params) => {
|
|
39
|
+
try {
|
|
40
|
+
const recognition = await apiClient.get(`/recognition/${params.recognitionId}`);
|
|
41
|
+
let textContent;
|
|
42
|
+
if (params.response_format === ResponseFormat.MARKDOWN) {
|
|
43
|
+
const lines = [`# Recognition`, ""];
|
|
44
|
+
if (recognition.badge) {
|
|
45
|
+
lines.push(`**Badge**: ${recognition.badge.title}`);
|
|
46
|
+
if (recognition.badge.description) {
|
|
47
|
+
lines.push(`*${recognition.badge.description}*`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
lines.push(`\n**Description**: ${recognition.description}`);
|
|
51
|
+
lines.push(`- **ID**: ${recognition.id}`);
|
|
52
|
+
lines.push(`- **Private**: ${recognition.isPrivate ? "Yes" : "No"}`);
|
|
53
|
+
if (recognition.createdAt) {
|
|
54
|
+
lines.push(`- **Created At**: ${recognition.createdAt}`);
|
|
55
|
+
}
|
|
56
|
+
if (recognition.recipients && recognition.recipients.length > 0) {
|
|
57
|
+
lines.push(`\n**Recipients:**`);
|
|
58
|
+
recognition.recipients.forEach((r) => {
|
|
59
|
+
lines.push(`- ${r.displayName}${r.jobTitle ? ` (${r.jobTitle})` : ""} - ${r.mail}`);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
textContent = lines.join("\n");
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
textContent = JSON.stringify(recognition, null, 2);
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
content: [{ type: "text", text: textContent }],
|
|
69
|
+
structuredContent: recognition,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
content: [{
|
|
75
|
+
type: "text",
|
|
76
|
+
text: handleApiError(error),
|
|
77
|
+
}],
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
// Search Recognitions Schema
|
|
82
|
+
const SearchRecognitionsInputSchema = z.object({
|
|
83
|
+
recipientEmail: z.string().email().optional().describe("Filter by recipient email address"),
|
|
84
|
+
badgeId: z.string().optional().describe("Filter by badge ID"),
|
|
85
|
+
startDate: z.string().optional().describe("Filter by start date (ISO format)"),
|
|
86
|
+
endDate: z.string().optional().describe("Filter by end date (ISO format)"),
|
|
87
|
+
isPrivate: z.boolean().optional().describe("Filter by privacy status"),
|
|
88
|
+
limit: z.number().int().min(1).max(MAX_PAGE_SIZE).default(DEFAULT_PAGE_SIZE)
|
|
89
|
+
.describe("Maximum number of recognitions to return"),
|
|
90
|
+
offset: z.number().int().min(0).default(0)
|
|
91
|
+
.describe("Number of recognitions to skip for pagination"),
|
|
92
|
+
response_format: z.nativeEnum(ResponseFormat).default(ResponseFormat.MARKDOWN)
|
|
93
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable"),
|
|
94
|
+
}).strict();
|
|
95
|
+
server.registerTool("teamflect_search_recognitions", {
|
|
96
|
+
title: "Search Recognitions",
|
|
97
|
+
description: `Search for recognitions in Teamflect based on filters.
|
|
98
|
+
|
|
99
|
+
This tool searches for recognitions matching the specified criteria. You can filter by recipient, badge, date range, and privacy status. Results are paginated.
|
|
100
|
+
|
|
101
|
+
Args:
|
|
102
|
+
- recipientEmail (string, optional): Filter by recipient email address
|
|
103
|
+
- badgeId (string, optional): Filter by badge ID
|
|
104
|
+
- startDate (string, optional): Filter by start date in ISO format (YYYY-MM-DD)
|
|
105
|
+
- endDate (string, optional): Filter by end date in ISO format (YYYY-MM-DD)
|
|
106
|
+
- isPrivate (boolean, optional): Filter by privacy status
|
|
107
|
+
- limit (number, optional): Maximum results to return, between 1-300 (default: 20)
|
|
108
|
+
- offset (number, optional): Number of results to skip for pagination (default: 0)
|
|
109
|
+
- response_format ('markdown' | 'json', optional): Output format (default: 'markdown')
|
|
110
|
+
|
|
111
|
+
Returns:
|
|
112
|
+
For JSON format: Structured data with schema:
|
|
113
|
+
{
|
|
114
|
+
"total": number,
|
|
115
|
+
"count": number,
|
|
116
|
+
"offset": number,
|
|
117
|
+
"recognitions": [
|
|
118
|
+
{
|
|
119
|
+
"id": string,
|
|
120
|
+
"description": string,
|
|
121
|
+
"createdAt": string,
|
|
122
|
+
"isPrivate": boolean,
|
|
123
|
+
"badge": {"id": string, "title": string, "description": string},
|
|
124
|
+
"recipients": [{"displayName": string, "jobTitle": string, "mail": string}]
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"has_more": boolean,
|
|
128
|
+
"next_offset": number
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
Examples:
|
|
132
|
+
- Use when: "Get all recognitions for john@example.com" -> params with recipientEmail="john@example.com"
|
|
133
|
+
- Use when: "List public recognitions this month" -> params with isPrivate=false and date filters
|
|
134
|
+
|
|
135
|
+
Error Handling:
|
|
136
|
+
- Returns "Error: Authentication failed" if API key is invalid
|
|
137
|
+
- Returns "Error: Rate limit exceeded" if too many requests`,
|
|
138
|
+
inputSchema: SearchRecognitionsInputSchema,
|
|
139
|
+
annotations: {
|
|
140
|
+
readOnlyHint: true,
|
|
141
|
+
destructiveHint: false,
|
|
142
|
+
idempotentHint: true,
|
|
143
|
+
openWorldHint: true,
|
|
144
|
+
},
|
|
145
|
+
}, async (params) => {
|
|
146
|
+
try {
|
|
147
|
+
const requestBody = {
|
|
148
|
+
limit: params.limit,
|
|
149
|
+
offset: params.offset,
|
|
150
|
+
};
|
|
151
|
+
if (params.recipientEmail)
|
|
152
|
+
requestBody.recipientEmail = params.recipientEmail;
|
|
153
|
+
if (params.badgeId)
|
|
154
|
+
requestBody.badgeId = params.badgeId;
|
|
155
|
+
if (params.startDate)
|
|
156
|
+
requestBody.startDate = params.startDate;
|
|
157
|
+
if (params.endDate)
|
|
158
|
+
requestBody.endDate = params.endDate;
|
|
159
|
+
if (params.isPrivate !== undefined)
|
|
160
|
+
requestBody.isPrivate = params.isPrivate;
|
|
161
|
+
const response = await apiClient.post("/recognition", requestBody);
|
|
162
|
+
const recognitions = response.recognitions || [];
|
|
163
|
+
const total = response.total ?? recognitions.length;
|
|
164
|
+
const hasMore = total > params.offset + recognitions.length;
|
|
165
|
+
const nextOffset = hasMore ? params.offset + recognitions.length : undefined;
|
|
166
|
+
const output = {
|
|
167
|
+
total,
|
|
168
|
+
count: recognitions.length,
|
|
169
|
+
offset: params.offset,
|
|
170
|
+
recognitions: recognitions.map((recognition) => ({
|
|
171
|
+
id: recognition.id,
|
|
172
|
+
description: recognition.description,
|
|
173
|
+
createdAt: recognition.createdAt || "",
|
|
174
|
+
isPrivate: recognition.isPrivate,
|
|
175
|
+
badge: recognition.badge || null,
|
|
176
|
+
recipients: recognition.recipients || [],
|
|
177
|
+
})),
|
|
178
|
+
has_more: hasMore,
|
|
179
|
+
...(nextOffset !== undefined ? { next_offset: nextOffset } : {}),
|
|
180
|
+
};
|
|
181
|
+
let textContent;
|
|
182
|
+
if (params.response_format === ResponseFormat.MARKDOWN) {
|
|
183
|
+
const lines = [`# Recognitions (${total} total)`, ""];
|
|
184
|
+
if (recognitions.length === 0) {
|
|
185
|
+
lines.push("No recognitions found matching the criteria.");
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
lines.push(`Showing ${recognitions.length} of ${total} recognitions\n`);
|
|
189
|
+
recognitions.forEach((recognition) => {
|
|
190
|
+
lines.push(`## ${recognition.badge?.title || "Recognition"} (${recognition.id})`);
|
|
191
|
+
lines.push(`- **Description**: ${recognition.description}`);
|
|
192
|
+
lines.push(`- **Private**: ${recognition.isPrivate ? "Yes" : "No"}`);
|
|
193
|
+
if (recognition.createdAt) {
|
|
194
|
+
lines.push(`- **Created At**: ${recognition.createdAt}`);
|
|
195
|
+
}
|
|
196
|
+
if (recognition.recipients && recognition.recipients.length > 0) {
|
|
197
|
+
lines.push(`\n**Recipients:**`);
|
|
198
|
+
recognition.recipients.forEach((r) => {
|
|
199
|
+
lines.push(`- ${r.displayName}${r.jobTitle ? ` (${r.jobTitle})` : ""} - ${r.mail}`);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
lines.push("");
|
|
203
|
+
});
|
|
204
|
+
if (hasMore) {
|
|
205
|
+
lines.push(`\n*Use offset=${nextOffset} to get more results*`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
textContent = lines.join("\n");
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
textContent = JSON.stringify(output, null, 2);
|
|
212
|
+
}
|
|
213
|
+
// Check character limit
|
|
214
|
+
if (textContent.length > CHARACTER_LIMIT) {
|
|
215
|
+
const truncated = output.recognitions.slice(0, Math.floor(output.recognitions.length / 2));
|
|
216
|
+
const truncatedOutput = { ...output, recognitions: truncated, truncated: true };
|
|
217
|
+
textContent = params.response_format === ResponseFormat.MARKDOWN
|
|
218
|
+
? `# Recognitions (Truncated)\n\nResponse truncated from ${output.recognitions.length} to ${truncated.length} recognitions. Use filters or pagination to see more results.\n\n${JSON.stringify(truncatedOutput, null, 2)}`
|
|
219
|
+
: JSON.stringify(truncatedOutput, null, 2);
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
content: [{ type: "text", text: textContent }],
|
|
223
|
+
structuredContent: output,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
return {
|
|
228
|
+
content: [{
|
|
229
|
+
type: "text",
|
|
230
|
+
text: handleApiError(error),
|
|
231
|
+
}],
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
// Create Recognition Schema
|
|
236
|
+
const CreateRecognitionInputSchema = z.object({
|
|
237
|
+
description: z.string().min(1).max(5000).describe("Recognition description (1-5000 characters)"),
|
|
238
|
+
badgeId: z.string().min(1).describe("Badge ID to assign"),
|
|
239
|
+
badgeTitle: z.string().min(1).optional().describe("Badge title (required by API, defaults to badgeId if not provided)"),
|
|
240
|
+
recipientEmails: z.array(z.string().email()).min(1).describe("Array of recipient email addresses"),
|
|
241
|
+
senderIdOrUPN: z.string().email().optional().describe("Sender email (optional, defaults to API key user)"),
|
|
242
|
+
isPrivate: z.boolean().default(false).describe("Whether the recognition is private (default: false)"),
|
|
243
|
+
response_format: z.nativeEnum(ResponseFormat).default(ResponseFormat.MARKDOWN)
|
|
244
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable"),
|
|
245
|
+
}).strict();
|
|
246
|
+
server.registerTool("teamflect_create_recognition", {
|
|
247
|
+
title: "Create Recognition",
|
|
248
|
+
description: `Create a new recognition in Teamflect.
|
|
249
|
+
|
|
250
|
+
This tool creates a recognition (award/badge) for one or more recipients. Recognitions can be public or private.
|
|
251
|
+
|
|
252
|
+
Args:
|
|
253
|
+
- description (string, required): Recognition description (1-5000 characters)
|
|
254
|
+
- badgeId (string, required): Badge ID to assign to the recognition
|
|
255
|
+
- recipientEmails (array, required): Array of recipient email addresses (at least one)
|
|
256
|
+
- senderIdOrUPN (string, optional): Sender email address (defaults to first recipient if not provided)
|
|
257
|
+
- isPrivate (boolean, optional): Whether the recognition is private (default: false)
|
|
258
|
+
- response_format ('markdown' | 'json', optional): Output format (default: 'markdown')
|
|
259
|
+
|
|
260
|
+
Returns:
|
|
261
|
+
The created recognition(s) with all details.
|
|
262
|
+
|
|
263
|
+
Error Handling:
|
|
264
|
+
- Returns "Error: Bad request" if required fields are missing or invalid
|
|
265
|
+
- Returns "Error: Permission denied" if you don't have permission to create recognitions`,
|
|
266
|
+
inputSchema: CreateRecognitionInputSchema,
|
|
267
|
+
annotations: {
|
|
268
|
+
readOnlyHint: false,
|
|
269
|
+
destructiveHint: false,
|
|
270
|
+
idempotentHint: false,
|
|
271
|
+
openWorldHint: true,
|
|
272
|
+
},
|
|
273
|
+
}, async (params) => {
|
|
274
|
+
try {
|
|
275
|
+
// API expects an array format where each element has recipientsIdsOrUPNS array and badgeTitle
|
|
276
|
+
const requestBody = [{
|
|
277
|
+
description: params.description,
|
|
278
|
+
badgeId: params.badgeId,
|
|
279
|
+
badgeTitle: params.badgeTitle || params.badgeId, // Use badgeId as fallback if badgeTitle not provided
|
|
280
|
+
recipientsIdsOrUPNS: params.recipientEmails,
|
|
281
|
+
senderIdOrUPN: params.senderIdOrUPN || params.recipientEmails[0], // Use first recipient as fallback if not provided
|
|
282
|
+
isPrivate: params.isPrivate,
|
|
283
|
+
}];
|
|
284
|
+
const response = await apiClient.post("/recognition/createNewRecognitions", requestBody);
|
|
285
|
+
const recognitions = response.recognitions || [];
|
|
286
|
+
let textContent;
|
|
287
|
+
if (params.response_format === ResponseFormat.MARKDOWN) {
|
|
288
|
+
if (recognitions.length === 1) {
|
|
289
|
+
const rec = recognitions[0];
|
|
290
|
+
textContent = `# Recognition Created\n\nRecognition created successfully.\n\n- **ID**: ${rec.id}\n- **Description**: ${rec.description}\n- **Badge**: ${rec.badge?.title || params.badgeId}\n- **Recipients**: ${rec.recipients?.map((r) => r.displayName).join(", ") || params.recipientEmails.join(", ")}\n- **Private**: ${rec.isPrivate ? "Yes" : "No"}`;
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
textContent = `# Recognitions Created\n\n${recognitions.length} recognition(s) created successfully.\n\n${recognitions.map((rec) => `- **${rec.badge?.title || "Recognition"}** (${rec.id}): ${rec.description}`).join("\n")}`;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
else {
|
|
297
|
+
textContent = JSON.stringify(response, null, 2);
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
content: [{ type: "text", text: textContent }],
|
|
301
|
+
structuredContent: response,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
return {
|
|
306
|
+
content: [{
|
|
307
|
+
type: "text",
|
|
308
|
+
text: handleApiError(error),
|
|
309
|
+
}],
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=recognitions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recognitions.js","sourceRoot":"","sources":["../../src/tools/recognitions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,C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C;oBACN,WAAW,GAAG,6BAA6B,YAAY,CAAC,MAAM,4CAA4C,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,KAAK,IAAI,aAAa,OAAO,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACjO,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAClD,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;gBAC9C,iBAAiB,EAAE,QAA8C;aAClE,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;qBAC5B,CAAC;aACH,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { TeamflectApiClient } from "../services/apiClient.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register review-related tools
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerReviewTools(server: McpServer, apiClient: TeamflectApiClient): void;
|
|
7
|
+
//# sourceMappingURL=reviews.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../src/tools/reviews.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAK9D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,GAAG,IAAI,CA2O1F"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { handleApiError } from "../services/errorHandler.js";
|
|
3
|
+
import { ResponseFormat } from "../types.js";
|
|
4
|
+
import { DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE, CHARACTER_LIMIT } from "../constants.js";
|
|
5
|
+
/**
|
|
6
|
+
* Register review-related tools
|
|
7
|
+
*/
|
|
8
|
+
export function registerReviewTools(server, apiClient) {
|
|
9
|
+
// Get Reviews Schema
|
|
10
|
+
const GetReviewsInputSchema = z.object({
|
|
11
|
+
revieweeEmail: z.string().email().optional().describe("Filter by reviewee email address"),
|
|
12
|
+
reviewerEmail: z.string().email().optional().describe("Filter by reviewer email address"),
|
|
13
|
+
status: z.string().optional().describe("Filter by review status"),
|
|
14
|
+
startDate: z.string().optional().describe("Filter by period start date (ISO format)"),
|
|
15
|
+
endDate: z.string().optional().describe("Filter by period end date (ISO format)"),
|
|
16
|
+
limit: z.number().int().min(1).max(MAX_PAGE_SIZE).default(DEFAULT_PAGE_SIZE)
|
|
17
|
+
.describe("Maximum number of reviews to return"),
|
|
18
|
+
offset: z.number().int().min(0).default(0)
|
|
19
|
+
.describe("Number of reviews to skip for pagination"),
|
|
20
|
+
response_format: z.nativeEnum(ResponseFormat).default(ResponseFormat.MARKDOWN)
|
|
21
|
+
.describe("Output format: 'markdown' for human-readable or 'json' for machine-readable"),
|
|
22
|
+
}).strict();
|
|
23
|
+
server.registerTool("teamflect_get_reviews", {
|
|
24
|
+
title: "Get Reviews",
|
|
25
|
+
description: `Retrieve a list of reviews from Teamflect based on filters.
|
|
26
|
+
|
|
27
|
+
This tool searches for reviews matching the specified criteria. You can filter by reviewee, reviewer, status, and date ranges. Results are paginated.
|
|
28
|
+
|
|
29
|
+
Args:
|
|
30
|
+
- revieweeEmail (string, optional): Filter by reviewee email address
|
|
31
|
+
- reviewerEmail (string, optional): Filter by reviewer email address
|
|
32
|
+
- status (string, optional): Filter by review status (e.g., "Finalized", "In Progress")
|
|
33
|
+
- startDate (string, optional): Filter by period start date in ISO format (YYYY-MM-DD)
|
|
34
|
+
- endDate (string, optional): Filter by period end date in ISO format (YYYY-MM-DD)
|
|
35
|
+
- limit (number, optional): Maximum results to return, between 1-300 (default: 20)
|
|
36
|
+
- offset (number, optional): Number of results to skip for pagination (default: 0)
|
|
37
|
+
- response_format ('markdown' | 'json', optional): Output format (default: 'markdown')
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
For JSON format: Structured data with schema:
|
|
41
|
+
{
|
|
42
|
+
"total": number,
|
|
43
|
+
"count": number,
|
|
44
|
+
"offset": number,
|
|
45
|
+
"reviews": [
|
|
46
|
+
{
|
|
47
|
+
"reviewId": string,
|
|
48
|
+
"reviewee": {"displayName": string, "mail": string},
|
|
49
|
+
"reviewer": {"displayName": string, "mail": string},
|
|
50
|
+
"status": string,
|
|
51
|
+
"reviewTemplate": string,
|
|
52
|
+
"periodStartDate": string,
|
|
53
|
+
"periodEndDate": string,
|
|
54
|
+
"ratingResults": [{"title": string, "score": number}],
|
|
55
|
+
"note": string,
|
|
56
|
+
"createdAt": string
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"has_more": boolean,
|
|
60
|
+
"next_offset": number
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Examples:
|
|
64
|
+
- Use when: "Get all reviews for john@example.com" -> params with revieweeEmail="john@example.com"
|
|
65
|
+
- Use when: "List finalized reviews this year" -> params with status="Finalized" and date filters
|
|
66
|
+
|
|
67
|
+
Error Handling:
|
|
68
|
+
- Returns "Error: Authentication failed" if API key is invalid
|
|
69
|
+
- Returns "Error: Rate limit exceeded" if too many requests`,
|
|
70
|
+
inputSchema: GetReviewsInputSchema,
|
|
71
|
+
annotations: {
|
|
72
|
+
readOnlyHint: true,
|
|
73
|
+
destructiveHint: false,
|
|
74
|
+
idempotentHint: true,
|
|
75
|
+
openWorldHint: true,
|
|
76
|
+
},
|
|
77
|
+
}, async (params) => {
|
|
78
|
+
try {
|
|
79
|
+
// API doesn't accept query parameters - fetch all and filter client-side
|
|
80
|
+
const response = await apiClient.get("/review/getReviews");
|
|
81
|
+
// Handle array response format
|
|
82
|
+
let allReviews = Array.isArray(response) ? response : [];
|
|
83
|
+
// Apply client-side filtering
|
|
84
|
+
let reviews = allReviews;
|
|
85
|
+
if (params.revieweeEmail) {
|
|
86
|
+
reviews = reviews.filter((r) => {
|
|
87
|
+
const revieweeEmail = r.reviewee?.mail || r.reviewee?.userPrincipalName || "";
|
|
88
|
+
return revieweeEmail.toLowerCase() === params.revieweeEmail.toLowerCase();
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (params.reviewerEmail) {
|
|
92
|
+
reviews = reviews.filter((r) => {
|
|
93
|
+
const reviewerEmail = r.reviewer?.userPrincipalName || r.reviewer?.mail || "";
|
|
94
|
+
return reviewerEmail.toLowerCase() === params.reviewerEmail.toLowerCase();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (params.status) {
|
|
98
|
+
reviews = reviews.filter((r) => r.status?.toLowerCase() === params.status.toLowerCase());
|
|
99
|
+
}
|
|
100
|
+
if (params.startDate) {
|
|
101
|
+
const start = new Date(params.startDate);
|
|
102
|
+
reviews = reviews.filter((r) => {
|
|
103
|
+
const periodStart = r.periodStartDate ? new Date(r.periodStartDate) : null;
|
|
104
|
+
return periodStart && periodStart >= start;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
if (params.endDate) {
|
|
108
|
+
const end = new Date(params.endDate);
|
|
109
|
+
reviews = reviews.filter((r) => {
|
|
110
|
+
const periodEnd = r.periodEndDate ? new Date(r.periodEndDate) : null;
|
|
111
|
+
return periodEnd && periodEnd <= end;
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Calculate total before pagination
|
|
115
|
+
const total = reviews.length;
|
|
116
|
+
// Apply pagination after filtering
|
|
117
|
+
const startIndex = params.offset;
|
|
118
|
+
const endIndex = startIndex + params.limit;
|
|
119
|
+
reviews = reviews.slice(startIndex, endIndex);
|
|
120
|
+
const hasMore = total > params.offset + reviews.length;
|
|
121
|
+
const nextOffset = hasMore ? params.offset + reviews.length : undefined;
|
|
122
|
+
const output = {
|
|
123
|
+
total,
|
|
124
|
+
count: reviews.length,
|
|
125
|
+
offset: params.offset,
|
|
126
|
+
reviews: reviews.map((review) => ({
|
|
127
|
+
reviewId: review.id || review.reviewId || "",
|
|
128
|
+
reviewee: review.reviewee ? {
|
|
129
|
+
displayName: review.reviewee.displayName || "",
|
|
130
|
+
mail: review.reviewee.mail || review.reviewee.userPrincipalName || ""
|
|
131
|
+
} : null,
|
|
132
|
+
reviewer: review.reviewer ? {
|
|
133
|
+
displayName: review.reviewer.displayName || "",
|
|
134
|
+
mail: review.reviewer.mail || review.reviewer.userPrincipalName || ""
|
|
135
|
+
} : null,
|
|
136
|
+
status: review.status || "",
|
|
137
|
+
reviewTemplate: review.reviewTemplate || "",
|
|
138
|
+
periodStartDate: review.periodStartDate || "",
|
|
139
|
+
periodEndDate: review.periodEndDate || "",
|
|
140
|
+
ratingResults: review.reviewRatingResults || review.ratingResults || [],
|
|
141
|
+
note: review.note || "",
|
|
142
|
+
createdAt: review.createdAt || "",
|
|
143
|
+
selfReviewSubmittedAt: review.selfReviewSubmittedAt || "",
|
|
144
|
+
isDeleted: review.isDeleted || false,
|
|
145
|
+
assignedNineBox: review.assignedNineBox || "",
|
|
146
|
+
createdBy: review.createdBy || null,
|
|
147
|
+
})),
|
|
148
|
+
has_more: hasMore,
|
|
149
|
+
...(nextOffset !== undefined ? { next_offset: nextOffset } : {}),
|
|
150
|
+
};
|
|
151
|
+
let textContent;
|
|
152
|
+
if (params.response_format === ResponseFormat.MARKDOWN) {
|
|
153
|
+
const lines = [`# Reviews (${total} total)`, ""];
|
|
154
|
+
if (reviews.length === 0) {
|
|
155
|
+
lines.push("No reviews found matching the criteria.");
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
lines.push(`Showing ${reviews.length} of ${total} reviews\n`);
|
|
159
|
+
reviews.forEach((review) => {
|
|
160
|
+
const reviewId = review.id || review.reviewId || "N/A";
|
|
161
|
+
lines.push(`## Review ${reviewId}`);
|
|
162
|
+
if (review.reviewee) {
|
|
163
|
+
const revieweeEmail = review.reviewee.mail || review.reviewee.userPrincipalName || "";
|
|
164
|
+
lines.push(`- **Reviewee**: ${review.reviewee.displayName || ""} (${revieweeEmail})`);
|
|
165
|
+
}
|
|
166
|
+
if (review.reviewer) {
|
|
167
|
+
const reviewerEmail = review.reviewer.mail || review.reviewer.userPrincipalName || "";
|
|
168
|
+
lines.push(`- **Reviewer**: ${review.reviewer.displayName || ""} (${reviewerEmail})`);
|
|
169
|
+
}
|
|
170
|
+
lines.push(`- **Status**: ${review.status || ""}`);
|
|
171
|
+
if (review.reviewTemplate) {
|
|
172
|
+
lines.push(`- **Template**: ${review.reviewTemplate}`);
|
|
173
|
+
}
|
|
174
|
+
if (review.periodStartDate && review.periodEndDate) {
|
|
175
|
+
lines.push(`- **Period**: ${review.periodStartDate} to ${review.periodEndDate}`);
|
|
176
|
+
}
|
|
177
|
+
const ratingResults = review.reviewRatingResults || review.ratingResults || [];
|
|
178
|
+
if (ratingResults.length > 0) {
|
|
179
|
+
lines.push(`\n**Ratings:**`);
|
|
180
|
+
ratingResults.forEach((r) => {
|
|
181
|
+
lines.push(`- ${r.title}: ${r.score || 0}${r.outOf ? `/${r.outOf}` : ""}`);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
if (review.note) {
|
|
185
|
+
lines.push(`\n**Note**: ${review.note}`);
|
|
186
|
+
}
|
|
187
|
+
if (review.createdAt) {
|
|
188
|
+
lines.push(`- **Created At**: ${review.createdAt}`);
|
|
189
|
+
}
|
|
190
|
+
lines.push("");
|
|
191
|
+
});
|
|
192
|
+
if (hasMore) {
|
|
193
|
+
lines.push(`\n*Use offset=${nextOffset} to get more results*`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
textContent = lines.join("\n");
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
textContent = JSON.stringify(output, null, 2);
|
|
200
|
+
}
|
|
201
|
+
// Check character limit
|
|
202
|
+
if (textContent.length > CHARACTER_LIMIT) {
|
|
203
|
+
const truncated = output.reviews.slice(0, Math.floor(output.reviews.length / 2));
|
|
204
|
+
const truncatedOutput = { ...output, reviews: truncated, truncated: true };
|
|
205
|
+
textContent = params.response_format === ResponseFormat.MARKDOWN
|
|
206
|
+
? `# Reviews (Truncated)\n\nResponse truncated from ${output.reviews.length} to ${truncated.length} reviews. Use filters or pagination to see more results.\n\n${JSON.stringify(truncatedOutput, null, 2)}`
|
|
207
|
+
: JSON.stringify(truncatedOutput, null, 2);
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
content: [{ type: "text", text: textContent }],
|
|
211
|
+
structuredContent: output,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
return {
|
|
216
|
+
content: [{
|
|
217
|
+
type: "text",
|
|
218
|
+
text: handleApiError(error),
|
|
219
|
+
}],
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
//# sourceMappingURL=reviews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviews.js","sourceRoot":"","sources":["../../src/tools/reviews.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAmB,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEpF;;GAEG;AACH,M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AAS,CAAC,MAAM,+DAA+D,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;oBAC3M,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YAC/C,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;gBAC9C,iBAAiB,EAAE,MAAiC;aACrD,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC;wBACR,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;qBAC5B,CAAC;aACH,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { TeamflectApiClient } from "../services/apiClient.js";
|
|
3
|
+
/**
|
|
4
|
+
* Register task-related tools
|
|
5
|
+
*/
|
|
6
|
+
export declare function registerTaskTools(server: McpServer, apiClient: TeamflectApiClient): void;
|
|
7
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/tools/tasks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAK9D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,GAAG,IAAI,CA2QxF"}
|