Report a defect

defect.createChanges dataCreates, updates or deletes something in your workspace.

What it does

Records a defect (a bug found by testing) in the connected workspace, usually from a failed test run case: pass runCaseId (the per-case result id from the run) and the title, description (steps, expected vs actual, where), severity and release are filled from the failed case and its run. It also creates a regression test case that checks the fix, filed with the original case's features. A second report for the same run case returns the open defect instead of a duplicate. The bug breakdown is a story breakdown without the "as a / I want" statement: its acceptance criteria always include "the reported defect no longer occurs" and "existing behaviour around the fix is unchanged". With push: true it is also filed as an issue in the workspace's GitLab project when one is connected. Open blocker / critical defects of a release hold its ship gate (release.readiness). Returns {defect, existing}.

Ask your agent

You don’t call defect.create yourself. Say something like this to Claude Code, Cursor or another MCP-connected agent:

  • “File a defect for the failed checkout case in the last run”
  • “Report this failure to GitLab”

Inputs

NameTypeDescription
runCaseId
optional
stringId of the failed test run case (its per-case result in a run). Optional for a defect not found by a run.
title
optional
stringShort summary. Defaults to "Fails: <case title>" from the run case.
description
optional
stringMarkdown. Defaults to steps, expected, actual and where, from the run case.
severity
optional
enumblocker, critical, major, minor or trivial. Defaults to the failed case's severity.
Allowed: blockercriticalmajorminortrivial
releaseId
optional
stringRelease it affects. Defaults to the run's release.
acceptanceCriteria
optional
string[]Extra acceptance criteria for the fix (the two defaults are always added).
edgeCases
optional
string[]Edge cases the fix must handle.
technicalNotes
optional
stringLikely cause, area of the code, or fix notes.
push
optional
booleanAlso file it as a GitLab issue (when the workspace has GitLab connected).

The MCP call

What the agent’s MCP client sends (placeholders in angle brackets):

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "defect.create",
    "arguments": {
      "runCaseId": "<runCaseId>"
    }
  }
}

Connect your agent

npx -y @testmaze/mcp init tmt_xxx
claude mcp add tm --scope project -- npx -y @testmaze/mcp

Create the token in your Test Maze workspace under Settings → MCP. Setup for Cursor, Cline, Gemini CLI and Codex CLI is shown there too.