Diagnose a Depot container build failure
depot_diagnose_buildDiagnose why a container build failed: pinpoint the failing step, return its error and log tail, and report cache effectiveness to distinguish code issues from cache misses.
Instructions
Explain why a Depot container build failed: locate the step that broke and return its error and the tail of its logs, alongside cache effectiveness for the build.
Use this for "why did my docker build fail". Unlike Depot CI, container builds have no server-side AI diagnosis, so this tool does the legwork an agent would otherwise do by hand: read the build, page through its steps, pick the step that reported an error (or the last step that actually executed), and fetch only that step's logs.
Pass projectId when you know it. Depot's build record does not include a project id and the steps API requires one, so without it this tool has to scan recent builds across your projects, which costs several extra requests. DEPOT_PROJECT_ID works as a default.
Also reports cachedSteps vs totalSteps and secondsSaved, which is the fastest way to see whether a slow build is a cache miss problem rather than a code problem.
Read-only: this cannot start, retry, or cancel a build. Container builds cannot be triggered through Depot's API at all — a human runs "depot build" locally, or CI runs it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| buildId | Yes | The build id, as shown by depot_list_builds or the Depot dashboard. | |
| projectId | No | The project that owns the build. Strongly preferred: without it the server has to search. | |
| tailLines | No | How many trailing log lines to return from the failing step. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| build | Yes | ||
| notes | Yes | ||
| logTail | Yes | ||
| projectId | Yes | ||
| stepCount | Yes | ||
| failingStep | No | ||
| cacheSummary | Yes | ||
| logTruncated | Yes | ||
| logPageCapHit | Yes | ||
| logNextPageToken | No | ||
| logLinesTruncated | Yes |