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
| Name | Type | Description |
|---|---|---|
runCaseIdoptional | string | Id of the failed test run case (its per-case result in a run). Optional for a defect not found by a run. |
titleoptional | string | Short summary. Defaults to "Fails: <case title>" from the run case. |
descriptionoptional | string | Markdown. Defaults to steps, expected, actual and where, from the run case. |
severityoptional | enum | blocker, critical, major, minor or trivial. Defaults to the failed case's severity. Allowed: blockercriticalmajorminortrivial |
releaseIdoptional | string | Release it affects. Defaults to the run's release. |
acceptanceCriteriaoptional | string[] | Extra acceptance criteria for the fix (the two defaults are always added). |
edgeCasesoptional | string[] | Edge cases the fix must handle. |
technicalNotesoptional | string | Likely cause, area of the code, or fix notes. |
pushoptional | boolean | Also 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.
More defects tools
- List defects
defect.list