Skip to main content
Glama

diagnose_test_failure

Analyze failing test output and source code to identify root causes, returning ranked hypotheses with confidence scores, evidence, and precise locations.

Instructions

Perform deep root-cause analysis of a failing test. Returns ranked hypotheses with confidence scores, evidence, and precise locations. Call this first when a test fails. Prefer this over guessing from the raw test output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
git_diffNoOptional recent git diff that may have introduced the failure
languageNoProgramming language, e.g. typescript, python, go, java
frameworkNoTest framework, e.g. jest, vitest, pytest, junit, go test
test_outputYesFull test failure output including stack traces, assertion messages, and any relevant logs
source_filesYesRelevant source files that may be involved in the failure. Prefer including the test file + the implementation under test.
additional_contextNoAny extra context the agent has about the failure

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not explicitly state whether the tool is read-only or has side effects, though 'root-cause analysis' implies non-mutating. It also doesn't mention authentication, rate limits, or error behavior. However, the output description (ranked hypotheses) gives some transparency about what to expect.

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

Conciseness5/5

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

The description is three sentences with no fluff. The main purpose is front-loaded, followed by the output type and a clear usage directive. Every sentence earns its place, and it is efficiently structured.

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

Completeness4/5

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

Given the complexity (6 params, 2 required) and no output schema, the description adequately covers the essential behavior and output. It explains what the tool returns (ranked hypotheses with confidence scores, evidence, locations) and when to use it. It could mention edge cases like empty results or specific input requirements, but the schema already covers input constraints. Overall, it's sufficient for an agent to call it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, meaning every parameter has a description in the schema itself. The tool description adds no parameter-specific details beyond that. Since the schema already documents each parameter thoroughly, the description doesn't need to repeat it. Baseline of 3 is appropriate.

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 states a specific verb ('Perform deep root-cause analysis') and resource ('a failing test'), and clearly distinguishes its output (ranked hypotheses with confidence scores, evidence, locations). This differentiates it from siblings like propose_minimal_fix and assess_fix_safety, which focus on fixing and safety assessment respectively.

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

Usage Guidelines4/5

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

The description explicitly says 'Call this first when a test fails' and contrasts with 'guessing from the raw test output', giving clear when-to-use guidance. It doesn't explicitly name alternatives or when-not-to-use, but the directive 'Call this first' is strong. The sibling tool names are not mentioned, but the context implies this is the diagnostic first step.

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