@azure-devops/mcp 2.4.0-nightly.20260311 → 2.4.0-nightly.20260313
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/dist/tools/core.js +33 -3
- package/dist/tools/repositories.js +6 -3
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/tools/core.js
CHANGED
|
@@ -12,8 +12,8 @@ function filterProjectsByName(projects, projectNameFilter) {
|
|
|
12
12
|
return projects.filter((project) => project.name?.toLowerCase().includes(lowerCaseFilter));
|
|
13
13
|
}
|
|
14
14
|
function configureCoreTools(server, tokenProvider, connectionProvider, userAgentProvider) {
|
|
15
|
-
server.tool(CORE_TOOLS.list_project_teams, "Retrieve a list of teams for
|
|
16
|
-
project: z.string().describe("The name or ID of the Azure DevOps project."),
|
|
15
|
+
server.tool(CORE_TOOLS.list_project_teams, "Retrieve a list of teams for an Azure DevOps project. If a project is not specified, you will be prompted to select one.", {
|
|
16
|
+
project: z.string().optional().describe("The name or ID of the Azure DevOps project. If not provided, a project selection prompt will be shown."),
|
|
17
17
|
mine: z.boolean().optional().describe("If true, only return teams that the authenticated user is a member of."),
|
|
18
18
|
top: z.number().optional().describe("The maximum number of teams to return. Defaults to 100."),
|
|
19
19
|
skip: z.number().optional().describe("The number of teams to skip for pagination. Defaults to 0."),
|
|
@@ -21,7 +21,37 @@ function configureCoreTools(server, tokenProvider, connectionProvider, userAgent
|
|
|
21
21
|
try {
|
|
22
22
|
const connection = await connectionProvider();
|
|
23
23
|
const coreApi = await connection.getCoreApi();
|
|
24
|
-
|
|
24
|
+
let resolvedProject = project;
|
|
25
|
+
if (!resolvedProject) {
|
|
26
|
+
const projects = await coreApi.getProjects("wellFormed", 100, 0, undefined, false);
|
|
27
|
+
if (!projects || projects.length === 0) {
|
|
28
|
+
return { content: [{ type: "text", text: "No projects found to select from." }], isError: true };
|
|
29
|
+
}
|
|
30
|
+
const result = await server.server.elicitInput({
|
|
31
|
+
mode: "form",
|
|
32
|
+
message: "Select the Azure DevOps project to list teams for.",
|
|
33
|
+
requestedSchema: {
|
|
34
|
+
type: "object",
|
|
35
|
+
properties: {
|
|
36
|
+
project: {
|
|
37
|
+
type: "string",
|
|
38
|
+
title: "Project",
|
|
39
|
+
description: "The Azure DevOps project to list teams for.",
|
|
40
|
+
oneOf: projects.map((p) => ({
|
|
41
|
+
const: p.name ?? p.id ?? "",
|
|
42
|
+
title: p.name ?? p.id ?? "Unknown project",
|
|
43
|
+
})),
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
required: ["project"],
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
if (result.action !== "accept" || !result.content?.project) {
|
|
50
|
+
return { content: [{ type: "text", text: "Project selection cancelled." }] };
|
|
51
|
+
}
|
|
52
|
+
resolvedProject = String(result.content.project);
|
|
53
|
+
}
|
|
54
|
+
const teams = await coreApi.getTeams(resolvedProject, mine, top, skip, false);
|
|
25
55
|
if (!teams) {
|
|
26
56
|
return { content: [{ type: "text", text: "No teams found" }], isError: true };
|
|
27
57
|
}
|
|
@@ -767,15 +767,18 @@ function configureRepoTools(server, tokenProvider, connectionProvider, userAgent
|
|
|
767
767
|
}
|
|
768
768
|
});
|
|
769
769
|
server.tool(REPO_TOOLS.get_pull_request_by_id, "Get a pull request by its ID.", {
|
|
770
|
-
repositoryId: z
|
|
770
|
+
repositoryId: z
|
|
771
|
+
.string()
|
|
772
|
+
.describe("The ID or name of the repository where the pull request is located. When using a repository name instead of a GUID, the project parameter must also be provided."),
|
|
771
773
|
pullRequestId: z.number().describe("The ID of the pull request to retrieve."),
|
|
774
|
+
project: z.string().optional().describe("Project ID or project name. Required when repositoryId is a repository name instead of a GUID."),
|
|
772
775
|
includeWorkItemRefs: z.boolean().optional().default(false).describe("Whether to reference work items associated with the pull request."),
|
|
773
776
|
includeLabels: z.boolean().optional().default(false).describe("Whether to include a summary of labels in the response."),
|
|
774
|
-
}, async ({ repositoryId, pullRequestId, includeWorkItemRefs, includeLabels }) => {
|
|
777
|
+
}, async ({ repositoryId, pullRequestId, project, includeWorkItemRefs, includeLabels }) => {
|
|
775
778
|
try {
|
|
776
779
|
const connection = await connectionProvider();
|
|
777
780
|
const gitApi = await connection.getGitApi();
|
|
778
|
-
const pullRequest = await gitApi.getPullRequest(repositoryId, pullRequestId,
|
|
781
|
+
const pullRequest = await gitApi.getPullRequest(repositoryId, pullRequestId, project, undefined, undefined, undefined, undefined, includeWorkItemRefs);
|
|
779
782
|
if (includeLabels) {
|
|
780
783
|
try {
|
|
781
784
|
const projectId = pullRequest.repository?.project?.id;
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageVersion = "2.4.0-nightly.
|
|
1
|
+
export const packageVersion = "2.4.0-nightly.20260313";
|