@azure-devops/mcp 2.4.0-nightly.20260310 → 2.4.0-nightly.20260311
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/dist/tools/work-items.js +39 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/tools/work-items.js
CHANGED
|
@@ -16,6 +16,7 @@ const WORKITEM_TOOLS = {
|
|
|
16
16
|
list_work_item_revisions: "wit_list_work_item_revisions",
|
|
17
17
|
get_work_items_for_iteration: "wit_get_work_items_for_iteration",
|
|
18
18
|
add_work_item_comment: "wit_add_work_item_comment",
|
|
19
|
+
update_work_item_comment: "wit_update_work_item_comment",
|
|
19
20
|
add_child_work_items: "wit_add_child_work_items",
|
|
20
21
|
link_work_item_to_pull_request: "wit_link_work_item_to_pull_request",
|
|
21
22
|
get_work_item_type: "wit_get_work_item_type",
|
|
@@ -259,6 +260,44 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
259
260
|
};
|
|
260
261
|
}
|
|
261
262
|
});
|
|
263
|
+
server.tool(WORKITEM_TOOLS.update_work_item_comment, "Update an existing comment on a work item by ID.", {
|
|
264
|
+
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
265
|
+
workItemId: z.number().describe("The ID of the work item."),
|
|
266
|
+
commentId: z.number().describe("The ID of the comment to update."),
|
|
267
|
+
text: z.string().describe("The updated comment text."),
|
|
268
|
+
format: z.enum(["markdown", "html"]).optional().default("html"),
|
|
269
|
+
}, async ({ project, workItemId, commentId, text, format }) => {
|
|
270
|
+
try {
|
|
271
|
+
const connection = await connectionProvider();
|
|
272
|
+
const orgUrl = connection.serverUrl;
|
|
273
|
+
const accessToken = await tokenProvider();
|
|
274
|
+
const body = { text };
|
|
275
|
+
const formatParameter = format === "markdown" ? 0 : 1;
|
|
276
|
+
const response = await fetch(`${orgUrl}/${project}/_apis/wit/workItems/${workItemId}/comments/${commentId}?format=${formatParameter}&api-version=${markdownCommentsApiVersion}`, {
|
|
277
|
+
method: "PATCH",
|
|
278
|
+
headers: {
|
|
279
|
+
"Authorization": `Bearer ${accessToken}`,
|
|
280
|
+
"Content-Type": "application/json",
|
|
281
|
+
"User-Agent": userAgentProvider(),
|
|
282
|
+
},
|
|
283
|
+
body: JSON.stringify(body),
|
|
284
|
+
});
|
|
285
|
+
if (!response.ok) {
|
|
286
|
+
throw new Error(`Failed to update work item comment: ${response.statusText}`);
|
|
287
|
+
}
|
|
288
|
+
const updatedComment = await response.text();
|
|
289
|
+
return {
|
|
290
|
+
content: [{ type: "text", text: updatedComment }],
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
catch (error) {
|
|
294
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
295
|
+
return {
|
|
296
|
+
content: [{ type: "text", text: `Error updating work item comment: ${errorMessage}` }],
|
|
297
|
+
isError: true,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
});
|
|
262
301
|
server.tool(WORKITEM_TOOLS.list_work_item_revisions, "Retrieve list of revisions for a work item by ID.", {
|
|
263
302
|
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
264
303
|
workItemId: z.number().describe("The ID of the work item to retrieve revisions for."),
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.4.0-nightly.
|
|
1
|
+
export const packageVersion = "2.4.0-nightly.20260311";
|