Skip to content

screencast_stop returns an empty response when no recording is active #2208

@ch-bas

Description

@ch-bas

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

  • I want to provide a PR to fix this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions