pipelines_get_build_log_by_id
Retrieve specific build log content from Azure DevOps by providing organization, project, build ID, and log ID parameters for debugging and analysis.
Instructions
Gets the content of a specific build log file by ID
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 | |
| logId | Yes | ID of the log to retrieve | |
| startLine | No | Starting line number for the log content, defaults to 0 | |
| endLine | No | Ending line number for the log content, defaults to the end of the log |
Implementation Reference
- src/tools/pipelines.ts:226-233 (handler)Handler function that retrieves the specific build log lines using the Azure DevOps Build API's getBuildLogLines method, with optional startLine and endLine parameters.async ({ organization, project, buildId, logId, startLine, endLine }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const logLines = await buildApi.getBuildLogLines(project, buildId, logId, startLine, endLine); return { content: [{ type: "text", text: JSON.stringify(logLines, null, 2) }], }; }
- src/tools/pipelines.ts:219-225 (schema)Zod schema defining the input parameters for the tool: organization, project, buildId, logId, and optional startLine/endLine.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"), logId: z.number().describe("ID of the log to retrieve"), startLine: z.number().optional().describe("Starting line number for the log content, defaults to 0"), endLine: z.number().optional().describe("Ending line number for the log content, defaults to the end of the log"), },
- src/tools/pipelines.ts:216-234 (registration)Registration of the 'pipelines_get_build_log_by_id' tool using McpServer.tool(), including description, schema, and inline handler."pipelines_get_build_log_by_id", "Gets the content of a specific build log file by ID", { 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"), logId: z.number().describe("ID of the log to retrieve"), startLine: z.number().optional().describe("Starting line number for the log content, defaults to 0"), endLine: z.number().optional().describe("Ending line number for the log content, defaults to the end of the log"), }, async ({ organization, project, buildId, logId, startLine, endLine }) => { const connection = await connectionManager.getConnection(organization); const buildApi = await connection.getBuildApi(); const logLines = await buildApi.getBuildLogLines(project, buildId, logId, startLine, endLine); return { content: [{ type: "text", text: JSON.stringify(logLines, null, 2) }], }; } );