@azure-devops/mcp 2.2.1-nightly.20251029 → 2.2.1-nightly.20251030

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
@@ -56,6 +56,8 @@ Interact with these Azure DevOps services:
56
56
  - **work_create_iterations**: Create new iterations in a specified Azure DevOps project.
57
57
  - **work_assign_iterations**: Assign existing iterations to a specific team in a project.
58
58
  - **work_get_team_capacity**: Get the team capacity of a specific team and iteration in a project.
59
+ - **work_update_team_capacity**: Update the team capacity of a team member for a specific iteration in a project.
60
+ - **work_get_iteration_capacities**: Get an iteration's capacity for all teams in iteration and project.
59
61
 
60
62
  ### 📅 Work Items
61
63
 
@@ -7,6 +7,8 @@ const WORK_TOOLS = {
7
7
  create_iterations: "work_create_iterations",
8
8
  assign_iterations: "work_assign_iterations",
9
9
  get_team_capacity: "work_get_team_capacity",
10
+ update_team_capacity: "work_update_team_capacity",
11
+ get_iteration_capacities: "work_get_iteration_capacities",
10
12
  };
11
13
  function configureWorkTools(server, _, connectionProvider) {
12
14
  server.tool(WORK_TOOLS.list_team_iterations, "Retrieve a list of iterations for a specific team in a project.", {
@@ -154,5 +156,91 @@ function configureWorkTools(server, _, connectionProvider) {
154
156
  };
155
157
  }
156
158
  });
159
+ server.tool(WORK_TOOLS.update_team_capacity, "Update the team capacity of a team member for a specific iteration in a project.", {
160
+ project: z.string().describe("The name or Id of the Azure DevOps project."),
161
+ team: z.string().describe("The name or Id of the Azure DevOps team."),
162
+ teamMemberId: z.string().describe("The team member Id for the specific team member."),
163
+ iterationId: z.string().describe("The Iteration Id to update the capacity for."),
164
+ activities: z
165
+ .array(z.object({
166
+ name: z.string().describe("The name of the activity (e.g., 'Development')."),
167
+ capacityPerDay: z.number().describe("The capacity per day for this activity."),
168
+ }))
169
+ .describe("Array of activities and their daily capacities for the team member."),
170
+ daysOff: z
171
+ .array(z.object({
172
+ start: z.string().describe("Start date of the day off in ISO format."),
173
+ end: z.string().describe("End date of the day off in ISO format."),
174
+ }))
175
+ .optional()
176
+ .describe("Array of days off for the team member, each with a start and end date in ISO format."),
177
+ }, async ({ project, team, teamMemberId, iterationId, activities, daysOff }) => {
178
+ try {
179
+ const connection = await connectionProvider();
180
+ const workApi = await connection.getWorkApi();
181
+ const teamContext = { project, team };
182
+ // Prepare the capacity update object
183
+ const capacityPatch = {
184
+ activities: activities.map((a) => ({
185
+ name: a.name,
186
+ capacityPerDay: a.capacityPerDay,
187
+ })),
188
+ daysOff: (daysOff || []).map((d) => ({
189
+ start: new Date(d.start),
190
+ end: new Date(d.end),
191
+ })),
192
+ };
193
+ // Update the team member's capacity
194
+ const updatedCapacity = await workApi.updateCapacityWithIdentityRef(capacityPatch, teamContext, iterationId, teamMemberId);
195
+ if (!updatedCapacity) {
196
+ return { content: [{ type: "text", text: "Failed to update team member capacity" }], isError: true };
197
+ }
198
+ // Simplify output
199
+ const simplifiedResult = {
200
+ teamMember: updatedCapacity.teamMember
201
+ ? {
202
+ displayName: updatedCapacity.teamMember.displayName,
203
+ id: updatedCapacity.teamMember.id,
204
+ uniqueName: updatedCapacity.teamMember.uniqueName,
205
+ }
206
+ : undefined,
207
+ activities: updatedCapacity.activities,
208
+ daysOff: updatedCapacity.daysOff,
209
+ };
210
+ return {
211
+ content: [{ type: "text", text: JSON.stringify(simplifiedResult, null, 2) }],
212
+ };
213
+ }
214
+ catch (error) {
215
+ const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
216
+ return {
217
+ content: [{ type: "text", text: `Error updating team capacity: ${errorMessage}` }],
218
+ isError: true,
219
+ };
220
+ }
221
+ });
222
+ server.tool(WORK_TOOLS.get_iteration_capacities, "Get an iteration's capacity for all teams in iteration and project.", {
223
+ project: z.string().describe("The name or Id of the Azure DevOps project."),
224
+ iterationId: z.string().describe("The Iteration Id to get capacity for."),
225
+ }, async ({ project, iterationId }) => {
226
+ try {
227
+ const connection = await connectionProvider();
228
+ const workApi = await connection.getWorkApi();
229
+ const rawResults = await workApi.getTotalIterationCapacities(project, iterationId);
230
+ if (!rawResults || !rawResults.teams || rawResults.teams.length === 0) {
231
+ return { content: [{ type: "text", text: "No iteration capacity assigned to the teams" }], isError: true };
232
+ }
233
+ return {
234
+ content: [{ type: "text", text: JSON.stringify(rawResults, null, 2) }],
235
+ };
236
+ }
237
+ catch (error) {
238
+ const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
239
+ return {
240
+ content: [{ type: "text", text: `Error getting iteration capacities: ${errorMessage}` }],
241
+ isError: true,
242
+ };
243
+ }
244
+ });
157
245
  }
158
246
  export { WORK_TOOLS, configureWorkTools };
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const packageVersion = "2.2.1-nightly.20251029";
1
+ export const packageVersion = "2.2.1-nightly.20251030";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-devops/mcp",
3
- "version": "2.2.1-nightly.20251029",
3
+ "version": "2.2.1-nightly.20251030",
4
4
  "description": "MCP server for interacting with Azure DevOps",
5
5
  "license": "MIT",
6
6
  "author": "Microsoft Corporation",