fetch_build_log
Retrieve TeamCity build logs by build ID using line-based pagination, tail mode, or streamed output to a file for large logs.
Instructions
Fetch a build log. Supports line-based pagination and streaming output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | 1-based page number | |
| tail | No | Tail mode: return last N lines | |
| buildId | No | Build ID (TeamCity internal id) | |
| encoding | No | Response encoding: 'text' (default) or 'stream'. 'stream' writes the whole log, or the requested line range, to outputPath; logs can be several GB | text |
| pageSize | No | Lines per page (default 500) | |
| lineCount | No | Max lines to return (overrides pageSize) | |
| startLine | No | 0-based start line (overrides page) | |
| outputPath | No | Optional absolute path to write streamed logs; defaults to a temp file when streaming | |
| buildNumber | No | Human build number (e.g., 54). If provided, optionally include buildTypeId to disambiguate. | |
| buildTypeId | No | Optional build type ID to disambiguate buildNumber | |
| minFreeDiskMb | No | Streaming only: disk space in MiB that must stay free on the target disk, otherwise the download aborts (default 1024, 0 disables the reserve) |