Show which commits implement a story or test case
spec.traceReadsOnly looks things up; never changes your workspace.What it does
Traceability lookup. With ref (a user story or test case id) returns the commits linked to it, including commits linked to the story's own test cases, and the work items declared for it. With commitSha (full or a prefix of at least 7 characters) returns the stories / test cases that commit implements. Links are written by the git post-commit hook and by npx @testmaze/mcp spec check-range in CI. Read-only.
Ask your agent
You don’t call spec.trace yourself. Say something like this to Claude Code, Cursor or another MCP-connected agent:
- “Which commits implemented the saved-card story?”
- “What requirement does commit 3f2a9c1 trace to?”
Inputs
| Name | Type | Description |
|---|---|---|
refoptional | string | User story id, or test case id / caseId. |
commitShaoptional | string | Commit sha or prefix (7+ characters). |
The MCP call
What the agent’s MCP client sends (placeholders in angle brackets):
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "spec.trace",
"arguments": {
"ref": "<ref>"
}
}
}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 spec-based development tools
- Check the spec-based development rules and your active work item
spec.status - Declare the user story or test case a code change is for
spec.start_work - Close the active work item on a branch
spec.finish_work - Check a commit message carries a valid Testmaze-Ref trailer
spec.check_commit