Skip to content

CLI skill's get_heapsnapshot_details example passes an extra positional argument that the CLI rejects #2919

Description

@coygeek

Description of the bug

The Memory Debugging examples in skills/chrome-devtools-cli/SKILL.md include chrome-devtools get_heapsnapshot_details "./snap.heapsnapshot" 123 # Detailed object properties. get_heapsnapshot_details takes a single positional, <filePath>, so the CLI rejects the example during argument parsing with Error: Unknown argument: 123 and exit status 1. An agent that copies the example gets an argument error instead of snapshot details. The example line is identical in the 1.10.1 npm package and on main at b2f522c (line 110 in both), and has been in this form since it was added in #2569 (1.8.0), when the command already took only filePath positionally.

Actual behavior

In both builds, step 5 printed Error: Unknown argument: 123 followed by the CLI's positional-arguments tip, with exit status 1. Step 6 showed the single <filePath> positional. The step 7 control exited 0 and printed ## Heap Snapshot Data, Objects: 19793, Total shallow size: 1,090 kB and the id,name,count,selfSize,retainedSize class table on 1.10.1 (Objects: 19382 on main).

The example's comment says "Detailed object properties", which matches the description of the separate get_heapsnapshot_object_details <filePath> <nodeId> command shown later in the same block; which command and arguments the example should use is left to the maintainers.

Reproduction

Executed on macOS with Node v24.21.0 and Google Chrome 154.0.8037.93 against the published chrome-devtools-mcp@1.10.1 package and a local build of main, with usage statistics and update checks disabled (CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1) and XDG_RUNTIME_DIR pointed at a scratch directory so the CLI daemon socket was private to the test. Scratch paths below are shortened to /tmp/x.

  1. npm i --prefix /tmp/x chrome-devtools-mcp@1.10.1 and run the following from /tmp/x/node_modules/.bin.
  2. chrome-devtools start --no-usage-statistics --no-performance-crux (headless and isolated by CLI default).
  3. chrome-devtools navigate_page 1 --url "http://localhost:<port>/" (any reachable page; I used a minimal page served on a loopback port).
  4. chrome-devtools take_heapsnapshot 1 /tmp/x/snap.heapsnapshot.
  5. Run the skill line with only the file path adapted: chrome-devtools get_heapsnapshot_details /tmp/x/snap.heapsnapshot 123.
  6. chrome-devtools get_heapsnapshot_details --help.
  7. Control: chrome-devtools get_heapsnapshot_details /tmp/x/snap.heapsnapshot.
  8. chrome-devtools stop.

I repeated the same steps with node build/src/bin/chrome-devtools.js from the main build.

Expectation

The skill's example should be a valid get_heapsnapshot_details invocation. The generated CLI definition declares get_heapsnapshot_details with one positional, filePath (string, required), and only optional flags (filterName, objectId, pageIdx, pageSize) in src/config/cli-options.ts (lines 497-543 at tag chrome-devtools-mcp-v1.10.1, lines 552-598 on main); get_heapsnapshot_details --help prints chrome-devtools get_heapsnapshot_details <filePath> [--filterName] [--objectId] [--pageIdx] [--pageSize]. The skill itself says required arguments are passed positionally and optional arguments use flags (skills/chrome-devtools-cli/SKILL.md:35).

Chrome DevTools MCP version

1.10.1 (npm) and main b2f522c (local build)

Chrome version

154.0.8037.93 (stable, headless, isolated)

Node version

v24.21.0

Operating system

macOS

Evidence

  • Expected source: src/config/cli-options.ts (get_heapsnapshot_details, lines 497-543 at tag chrome-devtools-mcp-v1.10.1, lines 552-598 on main), the get_heapsnapshot_details --help output in both builds, and skills/chrome-devtools-cli/SKILL.md:35.
  • Failure source: skills/chrome-devtools-cli/SKILL.md:110 (identical in the 1.10.1 npm package and on main) and the CLI output quoted under Actual behavior.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Fix check

Failing now: running the skill's get_heapsnapshot_details example (file path adapted) fails argument parsing with Error: Unknown argument: 123. Restored: whichever command the corrected example names, it passes argument parsing and validation as written and returns data when given valid inputs (for get_heapsnapshot_details, the snapshot file alone, as the step 7 control does). Control: get_heapsnapshot_details keeps rejecting unexpected extra positionals unless its contract is deliberately changed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions