Skip to content

CLI skill's emulate --geolocation "0x0" example fails with an invalid-longitude error #2907

Description

@coygeek

Description of the bug

The Emulation examples in skills/chrome-devtools-cli/SKILL.md include chrome-devtools emulate 1 --cpuThrottlingRate 4 --geolocation "0x0". The --geolocation value must be <latitude>,<longitude>; with "0x0" the command fails with Invalid longitude "undefined" and neither the geolocation nor the CPU throttling in the same call is applied. The example is identical in the 1.10.1 npm package and on main at b2f522c.

Actual behavior

Step 3 printed Invalid longitude "undefined". Longitude must be a number between -180 and 180. (exit status 0 on 1.10.1; 1 on main b2f522c, same message with an Error: prefix). "0x0" has no comma, so the whole string becomes the latitude (Number("0x0") is 0 as a hex literal) and the longitude is undefined. The step 4 control printed Emulation configured successfully, Emulating geolocation: latitude=0, longitude=0 and Emulating CPU throttling: 4x slowdown. From source (not separately observed): the transform throws during argument parsing, before the handler runs, so the CPU throttling in the failing call is not applied either.

Reproduction

Executed on macOS against the published 1.10.1 package and a local build of main b2f522c, with usage statistics and update checks disabled and XDG_RUNTIME_DIR pointed at a scratch directory so the CLI daemon socket was private to the test.

  1. npm i --prefix /tmp/x chrome-devtools-mcp@1.10.1.
  2. chrome-devtools start --no-usage-statistics --no-performance-crux (from /tmp/x/node_modules/.bin).
  3. Run the skill line verbatim: chrome-devtools emulate 1 --cpuThrottlingRate 4 --geolocation "0x0".
  4. Control: chrome-devtools emulate 1 --cpuThrottlingRate 4 --geolocation "0,0".
  5. chrome-devtools stop.

Expectation

The skill example should configure the emulation its comment describes ("Emulate CPU throttling and geolocation"). The emulate tool documents geolocation as "<latitude>,<longitude>" (src/tools/emulation.ts; docs/tool-reference.md, emulate), parsed by geolocationTransform in src/tools/ToolDefinition.ts, which splits on ,.

MCP configuration

CLI daemon started with --no-usage-statistics --no-performance-crux

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/tools/emulation.ts (geolocation description) and geolocationTransform in src/tools/ToolDefinition.ts, at tag chrome-devtools-mcp-v1.10.1 and main b2f522c.
  • Failure source: skills/chrome-devtools-cli/SKILL.md:82 (identical in 1.10.1 and main b2f522c) 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 geolocation example verbatim prints the invalid-longitude error. Restored: the skill's geolocation example, run verbatim, prints Emulation configured successfully with the geolocation and CPU throttling it describes, as the step 4 control does. Control: emulate keeps rejecting a geolocation string that is not <latitude>,<longitude>.

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