Get Deployment Context
get-deployment-contextDebug a failed deployment by fetching its metadata, step statuses, and the log of the first failed step. Optionally target a specific step for inspection.
Instructions
Fetch debug context for one specific deployment: metadata, all step statuses, and the log of the first failed step (auto-picked: status FAIL or TIMEOUT). Returns log:null on clean success — pass an explicit stepName to inspect a successful step.
Use when: user asks why a past deployment failed, names a deploymentLogId, or wants to inspect a specific step (apply, destroy, custom flow) of a historical deployment.
Do NOT use for the latest deployment's plan log — use get-plan-logs (no deploymentLogId needed, cheaper). For an error summary use get-error-analysis.
deploymentLogId is REQUIRED. Use search-deployments first to find one.
Returns { deployment, steps, log }. log is { stepName, events, truncated } or null when no failed step exists and no stepName was given. Step names look like 'tf:plan', 'tf:apply', 'opentofu:plan', 'terragrunt:plan', 'pulumi:preview', 'helm:diff', 'k8s:apply', 'git:clone', 'spec:load'. Targeting a NOT_STARTED step returns 400.
Example chain: search-deployments(envId, statuses="FAILURE") → get-deployment-context(deploymentLogId=)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deploymentLogId | Yes | Required. The deployment to inspect. If you don't have one, call search-deployments first. For the latest deployment's plan log, prefer get-plan-logs — it doesn't require an ID. | |
| stepName | No | Omit to auto-pick the first failed step (status FAIL or TIMEOUT); returns log:null if no failure. Common values: 'tf:plan', 'tf:apply', 'opentofu:plan', 'terragrunt:plan', 'pulumi:preview', 'helm:diff', 'k8s:apply', 'cf:change-set', 'ansible:playbook', 'git:clone', 'spec:load'. Cannot target a NOT_STARTED step. |