@mcp-apps/azure-devops-mcp-server
Version:
A Model Context Protocol (MCP) server for Azure DevOps integration
44 lines (42 loc) • 1.97 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPRCodeDiffsTool = void 0;
const zod_1 = require("zod");
const azure_devops_service_js_1 = require("../services/azure-devops-service.js");
exports.getPRCodeDiffsTool = {
name: "get-pr-code-diffs",
description: `
Retrieves actual code diffs for files in a pull request.
This tool provides line-by-line diff information for code changes
to enable detailed risk analysis of modifications.
Parameters:
- organizationUrl: Azure DevOps organization URL
- project: Project name containing the repository
- repositoryName: Name of the repository
- pullRequestId: ID of the pull request to analyze
- maxFiles: Maximum number of files to analyze (default: 50)
`,
parameters: {
organizationUrl: zod_1.z.string().describe("Azure DevOps organization URL"),
project: zod_1.z.string().describe("Project name"),
repositoryName: zod_1.z.string().describe("Repository name"),
pullRequestId: zod_1.z.number().int().describe("Pull request ID"),
maxFiles: zod_1.z.number().int().default(50).describe("Maximum files to analyze")
},
handler: async ({ organizationUrl, project, repositoryName, pullRequestId, maxFiles }) => {
try {
const service = new azure_devops_service_js_1.AzureDevOpsService();
const diffs = await service.getPRDiffs(organizationUrl, project, repositoryName, pullRequestId, maxFiles);
return {
content: [{
type: "text",
text: JSON.stringify(diffs, null, 2)
}]
};
}
catch (error) {
throw new Error(`Error retrieving PR code diffs: ${error instanceof Error ? error.message : String(error)}`);
}
}
};
//# sourceMappingURL=get-pr-code-diffs.js.map