Skip to main content
Glama

Get Trace Analysis

get_trace_analysis
Read-only

Analyze failing Playwright test traces to see the failing action, errors, console and request failures, and where to start debugging. Returns a trace-reading runbook when no analysis exists.

Instructions

See what happened inside a failing test. Where trace analysis is on, this is the failing action, errors, console errors, failed requests and the page near the failure, with where to start and what each further step costs. If no analysis is available it returns a runbook for reading the trace with the Playwright CLI (Playwright 1.59+). Pass projectId + testcase_id (the Playwright pw_test_id) for that case's analysis and a short-lived trace download URL; optionally scope with testrun_id. For an e2e test the trace is a markdown page, and the runbook returned says how to read it. Omit the ids to just get the runbook for a trace.zip you already have locally. If analysis_status is processing, call again shortly. To check anything else in an analysed trace, pass find with testcase_id and testrun_id: it searches actions and request file names without a download. Several failures from one run? Pass testcase_ids with testrun_id: one call, with the shared text sent once. Report the root cause and fix.

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_trace_analysis"
  }
}

Input Schema

NameRequiredDescriptionDefault
findNoPlain text to search for in this test's actions, and its requests by file name (not full URL), for example "quantity" or "cart|checkout" (| means or). Needs testcase_id and testrun_id, and a completed analysis. No match never proves the text is absent from the trace.
projectIdNoProject ID — required to resolve the hosted trace download URL
testrun_idNoOptional run scope for testcase_id (single run)
testcase_idNoPlaywright pw_test_id of the failing case whose hosted trace to resolve
testcase_idsNoSeveral pw_test_ids from one run, instead of testcase_id. Needs testrun_id. Results are under `tests`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / find
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 200,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Plain text to search for in this test's actions, and its requests by file name (not full URL), for example \"quantity\" or \"cart|checkout\" (| means or). Needs testcase_id and testrun_id, and a completed analysis. No match never proves the text is absent from the trace."
      +}
    • addedInput schema / properties / testcase_ids
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "maxItems": 10,
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Several pw_test_ids from one run, instead of testcase_id. Needs testrun_id. Results are under `tests`."
      +}
  2. Changed9 schema fields changedv2.2.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / projectId / description
      Previous value: -"Project ID (Required). The TestDino project identifier."New value: +"Project ID — required to resolve the hosted trace download URL"
    • changedInput schema / properties / projectId / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / testcase_id / description
      Previous value: -"Playwright pw_test_id of the failing case whose hosted trace to resolve."New value: +"Playwright pw_test_id of the failing case whose hosted trace to resolve"
    • changedInput schema / properties / testcase_id / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / testrun_id / description
      Previous value: -"Optional run scope for testcase_id (single run)."New value: +"Optional run scope for testcase_id (single run)"
    • changedInput schema / properties / testrun_id / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedInput schema / required
      Removed value: -[
      -  "projectId"
      -]
  3. Addedv2.0.2

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare a safe read (readOnlyHint=true, destructiveHint=false, openWorldHint=false), and the description still adds real behavior: the download URL is short-lived, the analysis may be asynchronously 'processing' and require a follow-up call, e2e traces are rendered as a markdown page, and batched results live under `tests` with shared text sent once.

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?

Purpose and the primary id combination come first, and nearly every sentence carries operational information (cost of further steps, polling, local-trace fallback). It is dense and slight redundancy exists around the runbook/markdown-page fallback, and the closing imperative 'Report the root cause and fix' is an instruction rather than tool description.

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

Completeness5/5

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

With no output schema, the description still conveys what comes back (failing action, errors, failed requests, surrounding page, per-step cost, download URL, `tests` grouping) and how to behave while analysis is processing. For a read-only, five-param diagnostic tool this is as complete as an agent needs.

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

Parameters4/5

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

Schema coverage is 100%, so the per-parameter descriptions already carry the baseline load. The description adds cross-parameter meaning the schema only hints at: the projectId/testcase_id pairing that yields the download URL, the run-scoping role of testrun_id, and the fact that testcase_ids returns results grouped under `tests`.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence ('See what happened inside a failing test') plus the enumeration of what the analysis contains (failing action, errors, console errors, failed requests, page near failure) states a specific resource and output shape. It doesn't name a sibling such as get_debug_evidence to distinguish itself, but the scope is unmistakable.

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

Usage Guidelines5/5

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

Explicit invocation branches are spelled out: pass projectId + testcase_id for a case's analysis, omit the ids to get only the runbook for a local trace.zip, re-call shortly if analysis_status is processing, use find for deeper searching, and use testcase_ids with testrun_id for several failures from one run. Each branch names the condition that selects it.

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