Skip to main content
Glama

Diagnose a Depot container build failure

depot_diagnose_build
Read-onlyIdempotent

Locate the failing step in a failed Depot container build, return its error and log tail, and report cache effectiveness to distinguish cache misses from code problems.

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. If asked to start one, say that the user runs "depot build" locally or CI runs it; do not run the CLI on the user's behalf or look for a token to do so.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildIdYesThe build id, as shown by depot_list_builds or the Depot dashboard.
projectIdNoThe project that owns the build. Strongly preferred: without it the server has to search.
tailLinesNoHow many trailing log lines to return from the failing step.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
buildYes
notesYes
logTailYes
projectIdYes
stepCountYes
failingStepNo
cacheSummaryYes
logTruncatedYes
logPageCapHitYes
logsUnavailableNo
logNextPageTokenNo
stepsUnavailableNo
logLinesTruncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.1
    • addedOutput schema / properties / logsUnavailable
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / stepsUnavailable
      Added value: +{
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already mark the tool read-only and idempotent, but the description adds meaningful behavioral detail: it cannot start, retry, or cancel builds, container builds cannot be triggered via Depot's API, omitting projectId triggers a costly project scan, and it reports cachedSteps vs totalSteps and secondsSaved. These details go well beyond the structured annotations and are consistent with them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is longer than average but front-loads the core purpose and every major section earns its place: what it returns, when to use it, parameter guidance, cache metrics, and the read-only boundary. Minor redundancy exists around the build being untriggerable, but the structure is clear and logical.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema and annotations covering read-only/idempotent behavior, so the description does not need to restate return values. It fully covers selection criteria, parameter trade-offs, failure semantics, and boundary conditions, making it complete for an agent to invoke correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds valuable parameter context: projectId is strongly preferred because the steps API requires it and omitting it forces a multi-project search, with DEPOT_PROJECT_ID as a default. It also explains the meaning of tailLines implicitly through 'tail of its logs' and notes the default behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Explain why a Depot container build failed' and details exactly what it returns: the broken step, its error, log tail, and cache effectiveness. It explicitly contrasts this tool with Depot CI diagnosis, distinguishing it from sibling tools such as depot_diagnose_ci_failure.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit trigger phrase ('why did my docker build fail'), names the alternative domain (Depot CI) where server-side AI diagnosis exists, and clarifies that this tool is for container builds that lack that diagnosis. It also provides operational guidance about when to pass projectId and when not to attempt starting a build.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.