build_get_log
Retrieve build logs from Azure DevOps by specifying the project and build ID, enabling efficient troubleshooting and monitoring of build processes with PAT authentication.
Instructions
Retrieves the logs for a specific build.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buildId | Yes | ID of the build to get the log for | |
| project | Yes | Project ID or name to get the build log for |
Implementation Reference
- src/tools/builds.ts:207-215 (handler)The handler function for the 'build_get_log' tool. It retrieves the build logs using the Azure DevOps Build API's getBuildLogs method for the given project and buildId, then returns the logs as JSON.async ({ project, buildId }) => { const connection = await connectionProvider(); const buildApi = await connection.getBuildApi(); const logs = await buildApi.getBuildLogs(project, buildId); return { content: [{ type: "text", text: JSON.stringify(logs, null, 2) }], }; }
- src/tools/builds.ts:203-206 (schema)Zod schema defining the input parameters: project (string) and buildId (number) for the 'build_get_log' tool.{ 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/builds.ts:200-216 (registration)Registration of the 'build_get_log' tool via server.tool call, referencing BUILD_TOOLS.get_log which maps to 'build_get_log'.server.tool( BUILD_TOOLS.get_log, "Retrieves the logs for a specific build.", { 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 ({ project, buildId }) => { const connection = await connectionProvider(); const buildApi = await connection.getBuildApi(); const logs = await buildApi.getBuildLogs(project, buildId); return { content: [{ type: "text", text: JSON.stringify(logs, null, 2) }], }; } );
- src/tools/builds.ts:12-22 (registration)BUILD_TOOLS constant defining the tool name mappings, including get_log: 'build_get_log'.const BUILD_TOOLS = { get_definitions: "build_get_definitions", get_definition_revisions: "build_get_definition_revisions", get_builds: "build_get_builds", get_log: "build_get_log", get_log_by_id: "build_get_log_by_id", get_changes: "build_get_changes", run_build: "build_run_build", get_status: "build_get_status", update_build_stage: "build_update_build_stage", };