Skip to main content
Glama

Explain Failure

why_did_this_fail
Read-only

Use this when you need to trace why a feature failed. Walk the upstream chain of a failing feature. Returns the diagnostics of the requested feature plus the diagnostics of every upstream feature in topological order (the requested feature is the last entry). Per-code hints are inline on every diagnostic — call lookup_diagnostics for the full catalogue. Pass { file?, code?, feature_id? }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
fileNoHosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project.
feature_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "candidateReason": {
      -    "description": "Why no candidate was derivable.",
      -    "type": "string"
      -  },
      -  "candidateStatus": {
      -    "description": "'no-automatic-candidate' means the region is the whole answer — no mechanical fix exists for that diagnostic kind.",
      -    "enum": [
      -      "candidates",
      -      "no-automatic-candidate"
      -    ],
      -    "type": "string"
      -  },
      -  "candidates": {
      -    "description": "Ordered concrete fixes, each with an AST-anchored patch, a predicted effect, and the geometry it was derived from.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "chain": {
      -    "description": "Upstream feature diagnostics in topological order; requested feature last.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "type": "string"
      -  },
      -  "errorCode": {
      -    "type": "string"
      -  },
      -  "feature_id": {
      -    "type": "string"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  },
      -  "repairRegion": {
      -    "additionalProperties": true,
      -    "description": "Minimal editable line ranges for the failure: { file, ranges: [{ startLine, endLine, role, featureId?, paramName? }] }.",
      -    "type": "object"
      -  },
      -  "targetDiagnosticId": {
      -    "description": "Id of the diagnostic the repair plan targets; pass it to repair_script.",
      -    "type": "string"
      -  },
      -  "trace": {
      -    "description": "Every captured feature joined to its call site, AST node range, diagnostics, inputs and dependents.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed1 schema field changed
    • addedInput schema / properties / file / description
      Added value: +"Hosted server: cannot read files from your machine — pass `code`, or `project:<slug>` for a saved project."
  3. Changed6 schema fields changed
    • addedOutput schema / properties / candidateReason
      Added value: +{
      +  "description": "Why no candidate was derivable.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / candidateStatus
      Added value: +{
      +  "description": "'no-automatic-candidate' means the region is the whole answer — no mechanical fix exists for that diagnostic kind.",
      +  "enum": [
      +    "candidates",
      +    "no-automatic-candidate"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / candidates
      Added value: +{
      +  "description": "Ordered concrete fixes, each with an AST-anchored patch, a predicted effect, and the geometry it was derived from.",
      +  "items": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / repairRegion
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Minimal editable line ranges for the failure: { file, ranges: [{ startLine, endLine, role, featureId?, paramName? }] }.",
      +  "type": "object"
      +}
    • addedOutput schema / properties / targetDiagnosticId
      Added value: +{
      +  "description": "Id of the diagnostic the repair plan targets; pass it to repair_script.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / trace
      Added value: +{
      +  "description": "Every captured feature joined to its call site, AST node range, diagnostics, inputs and dependents.",
      +  "items": {
      +    "additionalProperties": true,
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "chain": {
      +      "description": "Upstream feature diagnostics in topological order; requested feature last.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "type": "string"
      +    },
      +    "errorCode": {
      +      "type": "string"
      +    },
      +    "feature_id": {
      +      "type": "string"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  5. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.