pipelines_get_build_log
Retrieve build log files from Azure DevOps to analyze pipeline execution details and troubleshoot issues.
Instructions
Gets the list of log files for 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 log for | |
| buildId | Yes | ID of the build to get the log for |
Implementation Reference
- src/tools/pipelines.ts:205-212 (handler)The handler function that fetches the list of build logs for the specified build using the Azure DevOps Build API and returns them as a JSON string in the tool response.async ({ organization, project, buildId }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const logs = await buildApi.getBuildLogs(project, buildId); return { content: [{ type: "text", text: JSON.stringify(logs, null, 2) }], }; }
- src/tools/pipelines.ts:200-204 (schema)Zod schema defining the input parameters for the tool: organization (string), project (string), buildId (number).{ organization: z.string().describe("The name of the Azure DevOps organization"), project: z.string().describe("Project ID or name to get the build log for"), buildId: z.number().describe("ID of the build to get the log for"), },
- src/tools/pipelines.ts:197-213 (registration)Registration of the 'pipelines_get_build_log' tool on the MCP server, including name, description, input schema, and handler function.server.tool( "pipelines_get_build_log", "Gets the list of log files for 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 log for"), buildId: z.number().describe("ID of the build to get the log for"), }, async ({ organization, project, buildId }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const logs = await buildApi.getBuildLogs(project, buildId); return { content: [{ type: "text", text: JSON.stringify(logs, null, 2) }], }; } );