@azure-devops/mcp 2.2.1-nightly.20251103 → 2.2.1-nightly.20251104
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 +1 -1
- package/dist/tools/work.js +55 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,7 @@ Interact with these Azure DevOps services:
|
|
|
53
53
|
### ⚒️ Work
|
|
54
54
|
|
|
55
55
|
- **work_list_team_iterations**: Retrieve a list of iterations for a specific team in a project.
|
|
56
|
+
- **work_list_iterations**: List all iterations in a specified Azure DevOps project.
|
|
56
57
|
- **work_create_iterations**: Create new iterations in a specified Azure DevOps project.
|
|
57
58
|
- **work_assign_iterations**: Assign existing iterations to a specific team in a project.
|
|
58
59
|
- **work_get_team_capacity**: Get the team capacity of a specific team and iteration in a project.
|
package/dist/tools/work-items.js
CHANGED
|
@@ -56,7 +56,7 @@ function getLinkTypeFromName(name) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
function configureWorkItemTools(server, tokenProvider, connectionProvider, userAgentProvider) {
|
|
59
|
-
server.tool(WORKITEM_TOOLS.list_backlogs, "
|
|
59
|
+
server.tool(WORKITEM_TOOLS.list_backlogs, "Receive a list of backlogs for a given project and team.", {
|
|
60
60
|
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
61
61
|
team: z.string().describe("The name or ID of the Azure DevOps team."),
|
|
62
62
|
}, async ({ project, team }) => {
|
package/dist/tools/work.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { TreeStructureGroup } from "azure-devops-node-api/interfaces/WorkItemTrackingInterfaces.js";
|
|
4
|
+
import { TreeStructureGroup, TreeNodeStructureType } from "azure-devops-node-api/interfaces/WorkItemTrackingInterfaces.js";
|
|
5
5
|
const WORK_TOOLS = {
|
|
6
6
|
list_team_iterations: "work_list_team_iterations",
|
|
7
|
+
list_iterations: "work_list_iterations",
|
|
7
8
|
create_iterations: "work_create_iterations",
|
|
8
9
|
assign_iterations: "work_assign_iterations",
|
|
9
10
|
get_team_capacity: "work_get_team_capacity",
|
|
@@ -77,6 +78,59 @@ function configureWorkTools(server, _, connectionProvider) {
|
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
80
|
});
|
|
81
|
+
server.tool(WORK_TOOLS.list_iterations, "List all iterations in a specified Azure DevOps project.", {
|
|
82
|
+
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
83
|
+
depth: z.number().default(2).describe("Depth of children to fetch."),
|
|
84
|
+
}, async ({ project, depth }) => {
|
|
85
|
+
try {
|
|
86
|
+
const connection = await connectionProvider();
|
|
87
|
+
const workItemTrackingApi = await connection.getWorkItemTrackingApi();
|
|
88
|
+
const results = [];
|
|
89
|
+
if (depth === undefined) {
|
|
90
|
+
depth = 1;
|
|
91
|
+
}
|
|
92
|
+
// Get all root nodes, then filter for the root node with structureType "iteration"
|
|
93
|
+
const rootNodes = await workItemTrackingApi.getRootNodes(project, depth);
|
|
94
|
+
const iterationRoot = Array.isArray(rootNodes) ? rootNodes.find((node) => node.structureType === TreeNodeStructureType.Iteration) : undefined;
|
|
95
|
+
if (iterationRoot) {
|
|
96
|
+
// Only return the root and its children (if any)
|
|
97
|
+
results.push({
|
|
98
|
+
id: iterationRoot.id,
|
|
99
|
+
identifier: iterationRoot.identifier,
|
|
100
|
+
name: iterationRoot.name,
|
|
101
|
+
structureType: iterationRoot.structureType,
|
|
102
|
+
hasChildren: iterationRoot.hasChildren,
|
|
103
|
+
path: iterationRoot.path,
|
|
104
|
+
url: iterationRoot.url,
|
|
105
|
+
children: iterationRoot.children
|
|
106
|
+
? iterationRoot.children.map((child) => ({
|
|
107
|
+
id: child.id,
|
|
108
|
+
identifier: child.identifier,
|
|
109
|
+
name: child.name,
|
|
110
|
+
structureType: child.structureType,
|
|
111
|
+
hasChildren: child.hasChildren,
|
|
112
|
+
path: child.path,
|
|
113
|
+
url: child.url,
|
|
114
|
+
attributes: child.attributes,
|
|
115
|
+
}))
|
|
116
|
+
: [],
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (results.length === 0) {
|
|
120
|
+
return { content: [{ type: "text", text: "No iterations were found" }], isError: true };
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
content: [{ type: "text", text: JSON.stringify(results, null, 2) }],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
128
|
+
return {
|
|
129
|
+
content: [{ type: "text", text: `Error fetching iterations: ${errorMessage}` }],
|
|
130
|
+
isError: true,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
});
|
|
80
134
|
server.tool(WORK_TOOLS.assign_iterations, "Assign existing iterations to a specific team in a project.", {
|
|
81
135
|
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
82
136
|
team: z.string().describe("The name or ID of the Azure DevOps team."),
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.2.1-nightly.
|
|
1
|
+
export const packageVersion = "2.2.1-nightly.20251104";
|