Skip to main content
Glama
nikydobrev

Azure DevOps Multi-Organization MCP Server

by nikydobrev

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
NameRequiredDescriptionDefault
organizationYesThe name of the Azure DevOps organization
projectYesProject ID or name to get the build log for
buildIdYesID of the build to get the log for
logIdYesID of the log to retrieve
startLineNoStarting line number for the log content, defaults to 0
endLineNoEnding line number for the log content, defaults to the end of the log

Implementation Reference

  • 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) }], }; }
  • 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"), },
  • 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) }], }; } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nikydobrev/mcp-server-azure-devops-multi'

If you have feedback or need assistance with the MCP directory API, please join our Discord server