chrome-devtools-mcp icon indicating copy to clipboard operation
chrome-devtools-mcp copied to clipboard

screencast_stop returns an empty response when no recording is active

Open ch-bas opened this issue 5 months ago • 2 comments

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

  1. Start the MCP server with --experimentalScreencast=true
  2. Navigate to any page via new_page
  3. Call screencast_stop without calling screencast_start first
  4. 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

ch-bas avatar Jun 13 '26 09:06 ch-bas

Fix submitted in #2209

ch-bas avatar Jun 13 '26 10:06 ch-bas

This is now closed as #2209 has been merged.

nroscino avatar Jun 18 '26 12:06 nroscino