pipelines_get_build_changes
Retrieve code changes and commits associated with a specific Azure DevOps build to track modifications and understand what triggered the build.
Instructions
Gets the code changes (commits) associated with a build
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| organization | Yes | The name of the Azure DevOps organization | |
| project | Yes | Project ID or name to get the build changes for | |
| buildId | Yes | ID of the build to get changes for | |
| continuationToken | No | Continuation token for pagination | |
| top | No | Number of changes to retrieve, defaults to 100 | |
| includeSourceChange | No | Whether to include source changes in the results, defaults to false |
Implementation Reference
- src/tools/pipelines.ts:247-255 (handler)The async handler function that retrieves code changes (commits) for a build using the Azure DevOps Build API and returns them as a JSON-formatted text response.async ({ organization, project, buildId, continuationToken, top, includeSourceChange }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const changes = await buildApi.getBuildChanges(project, buildId, continuationToken, top, includeSourceChange); return { content: [{ type: "text", text: JSON.stringify(changes, null, 2) }], }; } );
- src/tools/pipelines.ts:239-246 (schema)Zod schema defining the input parameters, including organization, project, buildId, and optional pagination and filtering options.{ organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name to get the build changes for"), buildId: z.number().describe("ID of the build to get changes for"), continuationToken: z.string().optional().describe("Continuation token for pagination"), top: z.number().default(100).describe("Number of changes to retrieve, defaults to 100"), includeSourceChange: z.boolean().optional().describe("Whether to include source changes in the results, defaults to false"), },
- src/tools/pipelines.ts:236-255 (registration)The server.tool() call that registers the 'pipelines_get_build_changes' tool, including its name, description, input schema, and handler function.server.tool( "pipelines_get_build_changes", "Gets the code changes (commits) associated with a build", { organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name to get the build changes for"), buildId: z.number().describe("ID of the build to get changes for"), continuationToken: z.string().optional().describe("Continuation token for pagination"), top: z.number().default(100).describe("Number of changes to retrieve, defaults to 100"), includeSourceChange: z.boolean().optional().describe("Whether to include source changes in the results, defaults to false"), }, async ({ organization, project, buildId, continuationToken, top, includeSourceChange }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const changes = await buildApi.getBuildChanges(project, buildId, continuationToken, top, includeSourceChange); return { content: [{ type: "text", text: JSON.stringify(changes, null, 2) }], }; } );