@azure-devops/mcp 2.2.2-nightly.20251106 → 2.2.2-nightly.20251108

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.
@@ -480,17 +480,26 @@ function configureWorkItemTools(server, tokenProvider, connectionProvider, userA
480
480
  content: [{ type: "text", text: JSON.stringify(queryDetails, null, 2) }],
481
481
  };
482
482
  });
483
- server.tool(WORKITEM_TOOLS.get_query_results_by_id, "Retrieve the results of a work item query given the query ID.", {
483
+ server.tool(WORKITEM_TOOLS.get_query_results_by_id, "Retrieve the results of a work item query given the query ID. Supports full or IDs-only response types.", {
484
484
  id: z.string().describe("The ID of the query to retrieve results for."),
485
485
  project: z.string().optional().describe("The name or ID of the Azure DevOps project. If not provided, the default project will be used."),
486
486
  team: z.string().optional().describe("The name or ID of the Azure DevOps team. If not provided, the default team will be used."),
487
487
  timePrecision: z.boolean().optional().describe("Whether to include time precision in the results. Defaults to false."),
488
488
  top: z.number().default(50).describe("The maximum number of results to return. Defaults to 50."),
489
- }, async ({ id, project, team, timePrecision, top }) => {
489
+ responseType: z.enum(["full", "ids"]).default("full").describe("Response type: 'full' returns complete query results (default), 'ids' returns only work item IDs for reduced payload size."),
490
+ }, async ({ id, project, team, timePrecision, top, responseType }) => {
490
491
  const connection = await connectionProvider();
491
492
  const workItemApi = await connection.getWorkItemTrackingApi();
492
493
  const teamContext = { project, team };
493
494
  const queryResult = await workItemApi.queryById(id, teamContext, timePrecision, top);
495
+ // If ids mode, extract and return only the IDs
496
+ if (responseType === "ids") {
497
+ const ids = queryResult.workItems?.map((workItem) => workItem.id).filter((id) => id !== undefined) || [];
498
+ return {
499
+ content: [{ type: "text", text: JSON.stringify({ ids, count: ids.length }, null, 2) }],
500
+ };
501
+ }
502
+ // Default: return full query results
494
503
  return {
495
504
  content: [{ type: "text", text: JSON.stringify(queryResult, null, 2) }],
496
505
  };
@@ -81,20 +81,39 @@ function configureWorkTools(server, _, connectionProvider) {
81
81
  server.tool(WORK_TOOLS.list_iterations, "List all iterations in a specified Azure DevOps project.", {
82
82
  project: z.string().describe("The name or ID of the Azure DevOps project."),
83
83
  depth: z.number().default(2).describe("Depth of children to fetch."),
84
- }, async ({ project, depth }) => {
84
+ excludedIds: z.array(z.number()).optional().describe("An optional array of iteration IDs, and thier children, that should not be returned."),
85
+ }, async ({ project, depth, excludedIds: ids }) => {
85
86
  try {
86
87
  const connection = await connectionProvider();
87
88
  const workItemTrackingApi = await connection.getWorkItemTrackingApi();
89
+ let results = [];
88
90
  if (depth === undefined) {
89
91
  depth = 1;
90
92
  }
91
- const results = await workItemTrackingApi.getClassificationNodes(project, [], depth);
93
+ results = await workItemTrackingApi.getClassificationNodes(project, [], depth);
92
94
  // Handle null or undefined results
93
95
  if (!results) {
94
96
  return { content: [{ type: "text", text: "No iterations were found" }], isError: true };
95
97
  }
96
98
  // Filter out items with structureType=0 (Area nodes), only keep structureType=1 (Iteration nodes)
97
- const filteredResults = results.filter((node) => node.structureType === TreeNodeStructureType.Iteration);
99
+ let filteredResults = results.filter((node) => node.structureType === TreeNodeStructureType.Iteration);
100
+ // If specific IDs are provided, filter them out recursively (exclude matching nodes and their children)
101
+ if (ids && ids.length > 0) {
102
+ const filterOutIds = (nodes) => {
103
+ return nodes
104
+ .filter((node) => !node.id || !ids.includes(node.id))
105
+ .map((node) => {
106
+ if (node.children && node.children.length > 0) {
107
+ return {
108
+ ...node,
109
+ children: filterOutIds(node.children),
110
+ };
111
+ }
112
+ return node;
113
+ });
114
+ };
115
+ filteredResults = filterOutIds(filteredResults);
116
+ }
98
117
  if (filteredResults.length === 0) {
99
118
  return { content: [{ type: "text", text: "No iterations were found" }], isError: true };
100
119
  }
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const packageVersion = "2.2.2-nightly.20251106";
1
+ export const packageVersion = "2.2.2-nightly.20251108";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-devops/mcp",
3
- "version": "2.2.2-nightly.20251106",
3
+ "version": "2.2.2-nightly.20251108",
4
4
  "description": "MCP server for interacting with Azure DevOps",
5
5
  "license": "MIT",
6
6
  "author": "Microsoft Corporation",