@azure-devops/mcp 2.10.0-nightly.20260916 → 2.10.0-nightly.20260918
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.
|
@@ -33,6 +33,7 @@ const TOOL_ANNOTATIONS = {
|
|
|
33
33
|
repo_create_branch: ADDITIVE_ANNOTATIONS,
|
|
34
34
|
repo_file: READ_ONLY_ANNOTATIONS,
|
|
35
35
|
repo_pull_request: READ_ONLY_ANNOTATIONS,
|
|
36
|
+
repo_pull_request_org: READ_ONLY_ANNOTATIONS,
|
|
36
37
|
repo_pull_request_thread: READ_ONLY_ANNOTATIONS,
|
|
37
38
|
repo_pull_request_thread_write: MUTATING_ANNOTATIONS,
|
|
38
39
|
repo_pull_request_write: MUTATING_ANNOTATIONS,
|
|
@@ -9,6 +9,7 @@ import { createExternalContentResponse } from "../shared/content-safety.js";
|
|
|
9
9
|
const REPO_TOOLS = {
|
|
10
10
|
repo_repository: "repo_repository",
|
|
11
11
|
repo_pull_request: "repo_pull_request",
|
|
12
|
+
repo_pull_request_org: "repo_pull_request_org",
|
|
12
13
|
repo_pull_request_thread: "repo_pull_request_thread",
|
|
13
14
|
repo_branch: "repo_branch",
|
|
14
15
|
repo_file: "repo_file",
|
|
@@ -96,6 +97,36 @@ function trimPullRequest(pr, includeDescription = false) {
|
|
|
96
97
|
project: pr.repository?.project?.name,
|
|
97
98
|
};
|
|
98
99
|
}
|
|
100
|
+
function trimOrganizationPullRequest(pr) {
|
|
101
|
+
return {
|
|
102
|
+
...trimPullRequest(pr),
|
|
103
|
+
projectId: pr.repository?.project?.id,
|
|
104
|
+
repositoryId: pr.repository?.id,
|
|
105
|
+
createdBy: {
|
|
106
|
+
id: pr.createdBy?.id,
|
|
107
|
+
displayName: pr.createdBy?.displayName,
|
|
108
|
+
uniqueName: pr.createdBy?.uniqueName,
|
|
109
|
+
},
|
|
110
|
+
reviewers: pr.reviewers?.map((reviewer) => ({
|
|
111
|
+
id: reviewer.id,
|
|
112
|
+
displayName: reviewer.displayName,
|
|
113
|
+
uniqueName: reviewer.uniqueName,
|
|
114
|
+
vote: reviewer.vote,
|
|
115
|
+
isRequired: reviewer.isRequired,
|
|
116
|
+
})),
|
|
117
|
+
webUrl: pr.remoteUrl,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
async function getOrganizationPullRequests(connection, identityFilter, identityId, status, skip, top) {
|
|
121
|
+
const url = new URL(`${connection.serverUrl.replace(/\/$/, "")}/_apis/git/pullrequests`);
|
|
122
|
+
url.searchParams.set("api-version", "7.1");
|
|
123
|
+
url.searchParams.set("$skip", String(skip));
|
|
124
|
+
url.searchParams.set("$top", String(top));
|
|
125
|
+
url.searchParams.set(`searchCriteria.${identityFilter}`, identityId);
|
|
126
|
+
url.searchParams.set("searchCriteria.status", String(status));
|
|
127
|
+
const response = await connection.rest.get(url.toString(), { deserializeDates: true });
|
|
128
|
+
return response.result?.value ?? [];
|
|
129
|
+
}
|
|
99
130
|
function buildVersionDescriptor(version, versionType) {
|
|
100
131
|
if (!version)
|
|
101
132
|
return undefined;
|
|
@@ -159,7 +190,7 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
|
|
|
159
190
|
}
|
|
160
191
|
});
|
|
161
192
|
// --- repo_pull_request -----------------------------------------------------
|
|
162
|
-
server.tool(REPO_TOOLS.repo_pull_request, "Retrieve pull request data.
|
|
193
|
+
server.tool(REPO_TOOLS.repo_pull_request, "Retrieve pull request data for a specific repository or project, or retrieve one pull request by ID. For the authenticated user's active pull requests across the entire organization, use repo_pull_request_org.", {
|
|
163
194
|
action: z
|
|
164
195
|
.enum(["get", "list", "list_by_commits"])
|
|
165
196
|
.describe("The action to perform. Options: get (get a pull request by ID), list (list pull requests in a repository or project), list_by_commits (find pull requests that contain specific commit IDs)."),
|
|
@@ -319,6 +350,41 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
|
|
|
319
350
|
return { content: [{ type: "text", text: `Error with pull request operation: ${errorMessage}` }], isError: true };
|
|
320
351
|
}
|
|
321
352
|
});
|
|
353
|
+
// --- repo_pull_request_org -------------------------------------------------
|
|
354
|
+
server.tool(REPO_TOOLS.repo_pull_request_org, "List active pull requests across all projects and repositories in the organization for the authenticated user. Use this tool for organization-wide requests such as 'my pull requests' or 'pull requests awaiting my review'. For a specific project, repository, or pull request ID, use repo_pull_request.", {
|
|
355
|
+
is_reviewer: z
|
|
356
|
+
.boolean()
|
|
357
|
+
.default(false)
|
|
358
|
+
.describe("Set to true for active pull requests where the authenticated user is a reviewer. Set to false for active pull requests created by the authenticated user."),
|
|
359
|
+
reviewStatus: z
|
|
360
|
+
.enum(["all", "approved", "pending"])
|
|
361
|
+
.default("all")
|
|
362
|
+
.describe("Filter by the authenticated user's reviewer vote when is_reviewer is true: all includes every vote, approved includes Approved and Approved with suggestions, and pending includes only No vote."),
|
|
363
|
+
top: z.coerce.number().default(100).describe("The maximum number of active pull requests to retrieve before applying the reviewStatus filter. Defaults to 100."),
|
|
364
|
+
skip: z.coerce.number().default(0).describe("The number of active pull requests to skip before applying the reviewStatus filter. Defaults to 0."),
|
|
365
|
+
}, async ({ is_reviewer, reviewStatus, top, skip }) => {
|
|
366
|
+
try {
|
|
367
|
+
const currentUser = await getCurrentUserDetails(tokenProvider, connectionProvider, userAgentProvider);
|
|
368
|
+
const userId = currentUser.authenticatedUser.id;
|
|
369
|
+
const identityFilter = is_reviewer ? "reviewerId" : "creatorId";
|
|
370
|
+
const connection = await connectionProvider();
|
|
371
|
+
const pullRequests = await getOrganizationPullRequests(connection, identityFilter, userId, PullRequestStatus.Active, skip, top);
|
|
372
|
+
const filteredPullRequests = pullRequests.filter((pullRequest) => {
|
|
373
|
+
if (!is_reviewer || reviewStatus === "all")
|
|
374
|
+
return true;
|
|
375
|
+
const reviewer = pullRequest.reviewers?.find((item) => item.id === userId);
|
|
376
|
+
if (reviewStatus === "approved")
|
|
377
|
+
return reviewer?.vote === 10 || reviewer?.vote === 5;
|
|
378
|
+
return reviewer?.vote === 0;
|
|
379
|
+
});
|
|
380
|
+
const trimmedPullRequests = filteredPullRequests.map((pullRequest) => trimOrganizationPullRequest(pullRequest));
|
|
381
|
+
return { content: [{ type: "text", text: JSON.stringify(trimmedPullRequests, null, 2) }] };
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
|
385
|
+
return { content: [{ type: "text", text: `Error with organization pull request operation: ${errorMessage}` }], isError: true };
|
|
386
|
+
}
|
|
387
|
+
});
|
|
322
388
|
// --- repo_pull_request_thread ----------------------------------------------
|
|
323
389
|
server.tool(REPO_TOOLS.repo_pull_request_thread, "Retrieve pull request thread and comment data. Use the action parameter to specify the operation.", {
|
|
324
390
|
action: z.enum(["list", "list_comments"]).describe("The action to perform. Options: list (list comment threads on a pull request), list_comments (list comments in a specific thread)."),
|
package/dist/tools/wiki.js
CHANGED
|
@@ -19,7 +19,7 @@ function configureWikiTools(server, tokenProvider, connectionProvider, userAgent
|
|
|
19
19
|
.string()
|
|
20
20
|
.optional()
|
|
21
21
|
.describe("The full URL of the wiki page. Used for get_page_content. If provided, wikiIdentifier, project, and path are ignored. Supported patterns: https://dev.azure.com/{org}/{project}/_wiki/wikis/{wikiIdentifier}?pagePath=%2FMy%20Page and https://dev.azure.com/{org}/{project}/_wiki/wikis/{wikiIdentifier}/{pageId}/Page-Title"),
|
|
22
|
-
top: z.coerce.number().default(20).describe("
|
|
22
|
+
top: z.coerce.number().default(20).describe("Maximum number of pages to return for list_pages (up to 100; defaults to 20)."),
|
|
23
23
|
continuationToken: z.string().optional().describe("Token for pagination to retrieve the next set of pages. Used for list_pages."),
|
|
24
24
|
pageViewsForDays: z.coerce.number().optional().describe("Number of days to retrieve page views for. Used for list_pages. If not specified, page views are not included."),
|
|
25
25
|
recursionLevel: z
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.10.0-nightly.
|
|
1
|
+
export const packageVersion = "2.10.0-nightly.20260918";
|
package/package.json
CHANGED