screencast_stop returns an empty response when no recording is active
Description of the bug
Description
When screencast_stop is called with no active recording, the handler returns without appending any response line:
const data = context.getScreenRecorder();
if (!data) {
return; // empty tool response
}
The calling agent receives an empty result and cannot distinguish "recording stopped" from "nothing was recording" — it may assume success or retry. screencast_start already handles its inverse case with an explicit error ("a screencast recording is already in progress"), so stop is inconsistent.
Source
src/tools/screencast.ts, stopScreencast handler.
Reproduction
- Start the MCP server with
--experimentalScreencast=true - Navigate to any page via
new_page - Call
screencast_stopwithout callingscreencast_startfirst - Observe the tool response
Expectation
Actual behavior
Empty response — no text, no error.
Expected behavior
An explicit error message, e.g.:
Error: no active screencast recording to stop.
MCP configuration
No response
Chrome DevTools MCP version
1.2.0
Chrome version
No response
Coding agent version
No response
Model version
No response
Chat log
No response
Node version
No response
Operating system
None
Extra checklist
- [x] I want to provide a PR to fix this bug
Fix submitted in #2209
This is now closed as #2209 has been merged.