@azure-devops/mcp 2.2.2-nightly.20251108 → 2.2.2-nightly.20251110
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 +1 -0
- package/dist/tools/work-items.js +44 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ Interact with these Azure DevOps services:
|
|
|
70
70
|
- **wit_update_work_item**: Update a work item by ID with specified fields.
|
|
71
71
|
- **wit_create_work_item**: Create a new work item in a specified project and work item type.
|
|
72
72
|
- **wit_list_work_item_comments**: Retrieve a list of comments for a work item by ID.
|
|
73
|
+
- **wit_list_work_item_revisions**: Retrieve a list of revisions for a work item by ID.
|
|
73
74
|
- **wit_get_work_items_for_iteration**: Retrieve a list of work items for a specified iteration.
|
|
74
75
|
- **wit_add_work_item_comment**: Add a comment to a work item by ID.
|
|
75
76
|
- **wit_add_child_work_items**: Create one or more child work items of a specific work item type for the given parent ID.
|
package/dist/tools/work-items.js
CHANGED
|
@@ -13,6 +13,7 @@ const WORKITEM_TOOLS = {
|
|
|
13
13
|
update_work_item: "wit_update_work_item",
|
|
14
14
|
create_work_item: "wit_create_work_item",
|
|
15
15
|
list_work_item_comments: "wit_list_work_item_comments",
|
|
16
|
+
list_work_item_revisions: "wit_list_work_item_revisions",
|
|
16
17
|
get_work_items_for_iteration: "wit_get_work_items_for_iteration",
|
|
17
18
|
add_work_item_comment: "wit_add_work_item_comment",
|
|
18
19
|
add_child_work_items: "wit_add_child_work_items",
|
|
@@ -195,6 +196,49 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
|
|
|
195
196
|
content: [{ type: "text", text: comments }],
|
|
196
197
|
};
|
|
197
198
|
});
|
|
199
|
+
server.tool(WORKITEM_TOOLS.list_work_item_revisions, "Retrieve list of revisions for a work item by ID.", {
|
|
200
|
+
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
201
|
+
workItemId: z.number().describe("The ID of the work item to retrieve revisions for."),
|
|
202
|
+
top: z.number().default(50).describe("Optional number of revisions to retrieve. If not provided, all revisions will be returned."),
|
|
203
|
+
skip: z.number().optional().describe("Optional number of revisions to skip for pagination. Defaults to 0."),
|
|
204
|
+
expand: z
|
|
205
|
+
.enum(getEnumKeys(WorkItemExpand))
|
|
206
|
+
.default("None")
|
|
207
|
+
.optional()
|
|
208
|
+
.describe("Optional expand parameter to include additional details. Defaults to 'None'."),
|
|
209
|
+
}, async ({ project, workItemId, top, skip, expand }) => {
|
|
210
|
+
const connection = await connectionProvider();
|
|
211
|
+
const workItemApi = await connection.getWorkItemTrackingApi();
|
|
212
|
+
const revisions = await workItemApi.getRevisions(workItemId, top, skip, safeEnumConvert(WorkItemExpand, expand), project);
|
|
213
|
+
// Dynamically clean up identity objects in revision fields
|
|
214
|
+
// Identity objects typically have properties like displayName, url, _links, id, uniqueName, imageUrl, descriptor
|
|
215
|
+
if (revisions && Array.isArray(revisions)) {
|
|
216
|
+
revisions.forEach((revision) => {
|
|
217
|
+
if (revision.fields) {
|
|
218
|
+
Object.keys(revision.fields).forEach((fieldName) => {
|
|
219
|
+
const fieldValue = revision.fields ? revision.fields[fieldName] : undefined;
|
|
220
|
+
// Check if this is an identity object by looking for common identity properties
|
|
221
|
+
if (fieldValue &&
|
|
222
|
+
typeof fieldValue === "object" &&
|
|
223
|
+
!Array.isArray(fieldValue) &&
|
|
224
|
+
"displayName" in fieldValue &&
|
|
225
|
+
("url" in fieldValue || "_links" in fieldValue || "uniqueName" in fieldValue)) {
|
|
226
|
+
// Remove unwanted properties from identity objects
|
|
227
|
+
delete fieldValue.url;
|
|
228
|
+
delete fieldValue._links;
|
|
229
|
+
delete fieldValue.id;
|
|
230
|
+
delete fieldValue.uniqueName;
|
|
231
|
+
delete fieldValue.imageUrl;
|
|
232
|
+
delete fieldValue.descriptor;
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
content: [{ type: "text", text: JSON.stringify(revisions, null, 2) }],
|
|
240
|
+
};
|
|
241
|
+
});
|
|
198
242
|
server.tool(WORKITEM_TOOLS.add_child_work_items, "Create one or many child work items from a parent by work item type and parent id.", {
|
|
199
243
|
parentId: z.number().describe("The ID of the parent work item to create a child work item under."),
|
|
200
244
|
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.2.2-nightly.
|
|
1
|
+
export const packageVersion = "2.2.2-nightly.20251110";
|