pipelines_get_build_definition_revisions
Retrieve revision history for Azure DevOps build definitions to track changes, audit modifications, and restore previous configurations.
Instructions
Gets the revision history of a build definition
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 definition revisions for | |
| definitionId | Yes | ID of the build definition to get revisions for |
Implementation Reference
- src/tools/pipelines.ts:86-93 (handler)The inline handler function that executes the tool: connects to Azure DevOps, gets Build API, fetches definition revisions for the given project and definitionId, and returns JSON stringified response.async ({ organization, project, definitionId }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const revisions = await buildApi.getDefinitionRevisions(project, definitionId); return { content: [{ type: "text", text: JSON.stringify(revisions, null, 2) }], }; }
- src/tools/pipelines.ts:81-85 (schema)Input schema using Zod for validating parameters: organization, project, definitionId.{ organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name to get the build definition revisions for"), definitionId: z.number().describe("ID of the build definition to get revisions for"), },
- src/tools/pipelines.ts:78-94 (registration)Registration of the tool with McpServer.tool(), including name, description, schema, and handler.server.tool( "pipelines_get_build_definition_revisions", "Gets the revision history of a build definition", { organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name to get the build definition revisions for"), definitionId: z.number().describe("ID of the build definition to get revisions for"), }, async ({ organization, project, definitionId }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const revisions = await buildApi.getDefinitionRevisions(project, definitionId); return { content: [{ type: "text", text: JSON.stringify(revisions, null, 2) }], }; } );