Skip to main content
Glama

Analyze a test failure

get-failure
Read-onlyIdempotent

Analyze a single failure from the last Playwright run: full message, code frame, expected vs actual, stack trace, failed network requests, console errors, failure kind and concrete next steps.

Instructions

Analyze one failure from the most recent run-test execution: full message and code frame, expected vs actual, stack trace, failed network requests (4xx/5xx and dead endpoints), console errors, failure kind (assertion/timeout/browser-crash/syntax/config/server-unreachable) and concrete next steps. Use run-test first.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get-failure"
  }
}

Input Schema

NameRequiredDescriptionDefault
indexNo1-based failure index from the last run (default 1)
projectRootNoOnly used to re-read the stored report

Output Schema

NameRequiredDescriptionDefault
okYesfalse when the call failed (see error) or the tests it ran failed
errorNo
indexNo
totalNo
failureNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.13.0
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -{}
  2. Changed2 schema fields changedv0.6.1
    • addedInput schema / additionalProperties
      Added value: +{}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": false,
      +  "properties": {
      +    "error": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "hint": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "kind",
      +        "message"
      +      ],
      +      "type": "object"
      +    },
      +    "failure": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "actual": {
      +          "type": "string"
      +        },
      +        "expected": {
      +          "type": "string"
      +        },
      +        "file": {
      +          "type": "string"
      +        },
      +        "kind": {
      +          "type": "string"
      +        },
      +        "line": {
      +          "maximum": 9007199254740991,
      +          "minimum": -9007199254740991,
      +          "type": "integer"
      +        },
      +        "message": {
      +          "type": "string"
      +        },
      +        "project": {
      +          "type": "string"
      +        },
      +        "title": {
      +          "type": "string"
      +        },
      +        "tracePath": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "file",
      +        "title",
      +        "kind",
      +        "message"
      +      ],
      +      "type": "object"
      +    },
      +    "index": {
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "ok": {
      +      "description": "false when the call failed (see error) or the tests it ran failed",
      +      "type": "boolean"
      +    },
      +    "total": {
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  3. First observedv0.3.2

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, and the description adds the critical scoping constraint that only the latest run's failure is analyzable, plus the enumerated failure kinds. It does not cover edge behavior such as an out-of-range index or a missing prior run, which is the remaining gap.

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?

A single dense sentence with the prerequisite front-loaded and the payload enumerated compactly. The long list of included artifacts is information-dense rather than padded, though it approaches the limit of readability in one sentence.

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?

With an output schema present, return values need not be re-described, and the description still covers invocation prerequisites and scope. Only failure-mode behavior (no prior run, invalid index) is left unaddressed for an otherwise simple two-parameter read tool.

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 coverage is 100% and both parameters are documented there, so baseline 3 applies. The phrase 'one failure' and 'most recent run-test execution' subtly reinforces that index is relative to the last run and that projectRoot is only for re-reading the report, but no syntax or format detail is added beyond the schema.

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?

States a specific verb and resource ('Analyze one failure') and immediately scopes it to 'the most recent run-test execution', which separates it from load-report, analyze-history, and bisect-failure. The enumerated payload (message, code frame, stack trace, failure kind, next steps) makes the tool's output profile unmistakable.

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?

'Use run-test first' declares the hard prerequisite, so an agent knows this tool cannot be called cold. It does not explicitly exclude or route among near-siblings such as load-report or suggest-fix, so the alternative-selection guidance is clear but not exhaustive.

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