Get Depot CI job logs
depot_get_ci_logsFetch a bounded slice of persisted logs for any Depot CI job attempt, using filters like step, stream, or substring, plus page tokens to tail or walk forward through output.
Instructions
Fetch a bounded slice of the persisted logs for a Depot CI job attempt.
Try depot_diagnose_ci_failure first. It is cheaper, it already contains the relevant log lines with a diagnosis attached, and it identifies which job actually broke. Use this tool when you need detail the diagnosis did not include: the full traceback, output from a step that did not fail, or a specific pattern.
Defaults to the last 200 matching lines, because failures land at the end of a log. "grep" (case-insensitive substring, not a regex), "stepKey" and "stream" are applied by this server after it fetches pages from Depot, so they reduce what you receive but not what is read: a grep still walks the log page by page, up to DEPOT_MCP_MAX_LOG_PAGES pages (default 20), and is the most expensive way to use this tool. Prefer stepKey or stream, which at least keep the returned window small.
"id" accepts an attempt id, a job id, or a run id. Given a run id this picks that run's failed job (or its last job) and reads the latest attempt, mirroring what "depot ci logs" does.
Paging contract:
Without a pageToken you get the tail: the last "tailLines" matching lines of what was read. If the page cap stops the walk first, the result says so, the lines are the end of what was read rather than the end of the log, and nextPageToken continues forward from there.
With a pageToken you get the next window forward: up to "tailLines" lines in order from that point, and a new nextPageToken if more remain. Nothing in a forward window is ever dropped for the character budget; the window just closes early and the token resumes at the exact next line, so following nextPageToken until it is absent yields every line exactly once. That is how to follow a running job's output across turns.
Pass tokens back verbatim. Some are issued by this server rather than Depot; both are opaque.
Each line body is capped at 2000 characters ("bodyTruncated" marks the ones that were cut).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | An attempt id, job id, or run id. Attempt ids give the most precise result. | |
| grep | No | Case-insensitive substring filter applied to line bodies by this server after fetching. Not a regular expression. | |
| stream | No | Keep only one output stream. stderr alone is often enough to spot a failure. | |
| stepKey | No | Keep only lines from this step, as reported in a line's stepKey. | |
| pageToken | No | Continue forward from a previous nextPageToken instead of returning the tail. Use this to poll a running job or to read a log from the start. | |
| tailLines | No | Maximum log lines per call: the last N of what was read without a pageToken, the next N forward with one. | |
| targetType | No | What "id" refers to. Omit to let the server work it out. | |
| includeTimestamps | No | Prefix each rendered line with its ISO timestamp. Costs context; usually not needed. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | ||
| notes | Yes | ||
| target | Yes | ||
| truncated | Yes | ||
| pageCapHit | Yes | ||
| linesMatched | Yes | ||
| pagesFetched | Yes | ||
| linesReturned | Yes | ||
| nextPageToken | No |