Session Replay Tools
11 tools for recording, analyzing, and debugging user sessions. Registered after calling connect.
replay_start
Start recording a session. Captures DOM mutations (via rrweb), network requests, console messages, and errors.
Returns: Session ID for use with other replay tools.
replay_stop
Stop the current recording.
Returns: Session summary with event counts (DOM events, network requests, console messages, errors).
replay_capture_error
Start recording and block until a JavaScript error fires.
Returns: Failure bundle with the error, surrounding DOM state, network requests, and console output. Useful for reproducing intermittent errors.
replay_get_bundle
Get the failure bundle from a recording.
Returns:
- JavaScript errors captured
- Failed network requests
- Console errors
- Component state snapshot (if a framework was detected)
- Screenshot at time of error
replay_export_html
Export a recording as a self-contained, shareable HTML file.
| Parameter | Type | Default | Description |
|---|---|---|---|
outputPath | string | auto-generated | Output file path (confined to project root) |
Returns: Path to the HTML file containing:
- rrweb player for DOM replay
- Network request waterfall
- Console log viewer
- Error list
replay_compare
Diff two recorded sessions.
| Parameter | Type | Default | Description |
|---|---|---|---|
sessionA | string | required | First session ID |
sessionB | string | required | Second session ID |
Returns: Differences in network requests, console messages, errors, and session duration.
replay_network_cause
Trace JavaScript errors back to their probable network causes.
| Parameter | Type | Default | Description |
|---|---|---|---|
sessionId | string | — | Session to analyze (latest if omitted) |
Returns: Causal chains linking errors to failed or slow network requests. For example: POST /api/save → 500 caused TypeError: Cannot read property 'id' of undefined.
replay_bisect
Binary-search git commits to find which one introduced a visual regression.
| Parameter | Type | Default | Description |
|---|---|---|---|
goodCommit | string | required | Known-good commit hash |
badCommit | string | required | Known-bad commit hash |
pageUrl | string | required | Page to screenshot |
devServerCmd | string | required | Command to start dev server |
devServerUrl | string | required | URL to wait for |
threshold | number | 0.1 | Pixel diff threshold |
waitSelector | string | — | Wait for this selector before screenshot |
screenshotDelay | number | — | Additional delay in ms |
How it works: Checks out each commit via git bisect, starts the dev server, captures a screenshot, compares it, and narrows down to the exact commit that introduced the regression.
Returns: The regression-introducing commit hash, diff images for each step.
replay_persist
Save a recording to disk as JSON.
| Parameter | Type | Default | Description |
|---|---|---|---|
sessionId | string | — | Session to save (latest if omitted) |
Returns: File path and size.
replay_load
Load a persisted recording from disk back into memory.
| Parameter | Type | Default | Description |
|---|---|---|---|
sessionId | string | required | Session ID to load |
Restores the recording into the session store for further analysis with other replay tools.
replay_list
List all sessions — both persisted on disk and currently in memory.
Returns:
{
"persisted": [{ "id": "...", "path": "...", "size": "..." }],
"inMemory": [{ "id": "...", "eventCount": 123, "duration": "45s" }]
}