Skip to main content
Glama
ennuiii

Azure DevOps MCP Server with PAT Authentication

by ennuiii

build_get_log_by_id

Retrieve a specific build log by ID from Azure DevOps, allowing access to detailed log content within a specified line range for targeted debugging and analysis.

Instructions

Get a specific build log by log ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildIdYesID of the build to get the log for
endLineNoEnding line number for the log content, defaults to the end of the log
logIdYesID of the log to retrieve
projectYesProject ID or name to get the build log for
startLineNoStarting line number for the log content, defaults to 0

Implementation Reference

  • Handler function that calls Azure DevOps Build API to retrieve specific log lines (* to endLine) for a given build and log ID.
    async ({ project, buildId, logId, startLine, endLine }) => { const connection = await connectionProvider(); 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) }], }; }
  • Input validation schema using Zod for the tool parameters.
    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 'build_get_log_by_id' tool on the MCP server via server.tool(BUILD_TOOLS.get_log_by_id, ...), where BUILD_TOOLS.get_log_by_id = 'build_get_log_by_id'.
    server.tool( BUILD_TOOLS.get_log_by_id, "Get a specific build log by log ID.", { 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 ({ project, buildId, logId, startLine, endLine }) => { const connection = await connectionProvider(); 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) }], }; } );
  • Constant mapping in BUILD_TOOLS object linking internal key 'get_log_by_id' to the actual tool name 'build_get_log_by_id'.
    get_log_by_id: "build_get_log_by_id",

Other Tools

Related Tools

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/ennuiii/DevOpsMcpPAT'

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