Skip to main content
Glama

analyze_test_failure

Analyze failed tests with forensic details including logs, screenshots, error classification, and comparison with last passed execution to identify root causes.

Instructions

๐Ÿ” Deep forensic analysis of failed test including logs, screenshots, error classification, and similar failures. ๐Ÿ’ก NEW: Compare with last passed execution to see what changed! ๐Ÿ’ก TIP: Can be auto-invoked from Zebrunner test URLs like: https://workspace.zebrunner.com/projects/PROJECT/automation-launches/LAUNCH_ID/tests/TEST_ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testIdYesTest ID (e.g., 5451420)
testRunIdYesTest Run ID / Launch ID (e.g., 120806)
projectKeyNoProject key (e.g., 'MCP') - alternative to projectId
projectIdNoProject ID - alternative to projectKey
includeScreenshotsNoInclude screenshot links
includeLogsNoInclude log analysis
includeArtifactsNoInclude all test artifacts
includePageSourceNoInclude page source analysis
includeVideoNoInclude video URL
analyzeSimilarFailuresNoFind similar failures in the launch
analyzeScreenshotsWithAINoDownload and analyze screenshots with AI (Claude Vision)
screenshotAnalysisTypeNoScreenshot analysis type: basic (metadata+OCR) or detailed (includes Claude Vision)detailed
formatNoOutput format: detailed, summary, or jira (ready for Jira ticket creation)detailed
compareWithLastPassedNoCompare current failure with last passed execution to identify what changed

Implementation Reference

  • MCP tool registration for 'analyze_test_failure', including tool name, description, Zod input schema inline, and handler that calls reportingHandlers.analyzeTestFailureById(args). Note: schema imported from ./types/api.js but defined inline in registration.
    server.tool( "analyze_test_failure", "๐Ÿ” Deep forensic analysis of a failed test including logs, screenshots, error classification, and similar failures", { testId: z.number().int().positive().describe("Test ID (e.g., 5451420)"), testRunId: z.number().int().positive().describe("Test Run ID / Launch ID (e.g., 120806)"), projectKey: z.string().min(1).optional().describe("Project key (e.g., 'MCP') - alternative to projectId"), projectId: z.number().int().positive().optional().describe("Project ID - alternative to projectKey"), includeScreenshots: z.boolean().default(true).describe("Include screenshot analysis"), includeLogs: z.boolean().default(true).describe("Include log analysis"), includeArtifacts: z.boolean().default(true).describe("Include all test artifacts"), includePageSource: z.boolean().default(true).describe("Include page source analysis"), includeVideo: z.boolean().default(false).describe("Include video URL"), analyzeSimilarFailures: z.boolean().default(true).describe("Find similar failures in the launch"), format: z.enum(['detailed', 'summary']).default('detailed').describe("Output format: detailed or summary") }, async (args) => reportingHandlers.analyzeTestFailureById(args) );
  • Zod input schema definition AnalyzeTestFailureInputSchema used for validating tool parameters like testId, testRunId, analysis options (screenshots, logs, video, similar failures). Imported and used in server registration.
    export const AnalyzeTestFailureInputSchema = z.object({ testId: z.number().int().positive(), testRunId: z.number().int().positive(), // launchId projectKey: z.string().min(1).optional(), projectId: z.number().int().positive().optional(), includeScreenshots: z.boolean().default(true), includeLogs: z.boolean().default(true), includeArtifacts: z.boolean().default(true), includePageSource: z.boolean().default(true), includeVideo: z.boolean().default(false), analyzeSimilarFailures: z.boolean().default(true), format: z.enum(['detailed', 'summary']).default('detailed') });
  • Handler function for the tool - delegates execution to ZebrunnerReportingToolHandlers instance's analyzeTestFailureById method.
    async (args) => reportingHandlers.analyzeTestFailureById(args) );
  • Instantiation of ZebrunnerReportingToolHandlers with reportingClient, providing the analyzeTestFailureById method (definition not found in codebase).
    const reportingHandlers = new ZebrunnerReportingToolHandlers(reportingClient);
  • ZebrunnerReportingClient instantiation used by reporting handlers for API calls to fetch test data, logs, screenshots needed for failure analysis.
    const reportingClient = new ZebrunnerReportingClient(reportingConfig);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/maksimsarychau/mcp-zebrunner'

If you have feedback or need assistance with the MCP directory API, please join our Discord server