Skip to content

fix: report unknown tool arguments#2064

Merged
zyzyzyryxy merged 1 commit into
ChromeDevTools:mainfrom
popsiclelmlm:allow-extra-tool-arguments
May 15, 2026
Merged

fix: report unknown tool arguments#2064
zyzyzyryxy merged 1 commit into
ChromeDevTools:mainfrom
popsiclelmlm:allow-extra-tool-arguments

Conversation

@popsiclelmlm

@popsiclelmlm popsiclelmlm commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • register tool input schemas as passthrough so extra named arguments reach ToolHandler validation
  • report unknown arguments with an explicit error that names the unknown and expected arguments
  • stop before invoking tool handlers when unknown arguments are present
  • add ToolHandler coverage for reporting an extra argument

Fixes #1940

Tests

  • npm run check-format
  • npx tsc --noEmitOnError false (emits build artifacts but still reports the existing chrome-devtools-frontend type conflict in ModelImpl.ts)
  • node --experimental-strip-types --no-warnings=ExperimentalWarning scripts/post-build.ts
  • NODE_TEST_REPORTER=spec npm run test:no-build -- tests/ToolHandler.test.ts

@google-cla

google-cla Bot commented May 15, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@popsiclelmlm popsiclelmlm changed the title Allow extra tool arguments to be ignored fix: allow extra tool arguments to be ignored May 15, 2026

@OrKoN OrKoN left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per #1940 I do not think we want to silently swallow unknown parameters instead we want to improve the error message? cc @zyzyzyryxy

@OrKoN OrKoN requested a review from zyzyzyryxy May 15, 2026 09:36
@popsiclelmlm popsiclelmlm changed the title fix: allow extra tool arguments to be ignored fix: report unknown tool arguments May 15, 2026
@popsiclelmlm popsiclelmlm force-pushed the allow-extra-tool-arguments branch from 3041178 to 3172df2 Compare May 15, 2026 09:46
@popsiclelmlm

Copy link
Copy Markdown
Contributor Author

Thanks, that makes sense. I updated the PR so unknown arguments are no longer silently ignored. The registered schema now lets the call reach the tool handler, but the handler returns an explicit error naming the unknown argument(s) and the expected arguments, then stops before invoking the tool.\n\nI also retitled the PR and amended the commit to reflect that behavior. Verified with:\n- npm run check-format\n- NODE_TEST_REPORTER=spec npm run test:no-build -- tests/ToolHandler.test.ts after rebuilding the emitted JS with npx tsc --noEmitOnError false and scripts/post-build.ts\n\nThe full TypeScript check still hits the existing chrome-devtools-frontend duplicate type declaration reported earlier.

@zyzyzyryxy zyzyzyryxy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks about right.
CLA still seem to be not resolved, so cannot approve just yet.

Comment thread src/ToolHandler.ts Outdated
Comment thread src/ToolHandler.ts Outdated
@popsiclelmlm popsiclelmlm force-pushed the allow-extra-tool-arguments branch from 3172df2 to edd845d Compare May 15, 2026 15:44
@popsiclelmlm

Copy link
Copy Markdown
Contributor Author

Thanks again. I applied both review suggestions and updated the PR description to match the current behavior.

Verified again with:

  • npm run check-format
  • npx tsc --noEmitOnError false (still emits build artifacts and still reports the existing chrome-devtools-frontend duplicate type declaration in ModelImpl.ts)
  • node --experimental-strip-types --no-warnings=ExperimentalWarning scripts/post-build.ts
  • NODE_TEST_REPORTER=spec npm run test:no-build -- tests/ToolHandler.test.ts

The cla/google check is passing now. Could you please take another look when you have a chance?

@popsiclelmlm popsiclelmlm requested review from OrKoN and zyzyzyryxy May 15, 2026 15:46
@zyzyzyryxy zyzyzyryxy added this pull request to the merge queue May 15, 2026
Merged via the queue into ChromeDevTools:main with commit 041b208 May 15, 2026
18 checks passed
pull Bot pushed a commit to Spencerx/chrome-devtools-mcp that referenced this pull request May 18, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.0.0](ChromeDevTools/chrome-devtools-mcp@chrome-devtools-mcp-v0.26.0...chrome-devtools-mcp-v1.0.0)
(2026-05-18)


### 🎉 Features

* report new URL after actions that trigger navigation
([ChromeDevTools#1853](ChromeDevTools#1853))
([b594858](ChromeDevTools@b594858))
* support filePath in evaluate_script
([ChromeDevTools#2054](ChromeDevTools#2054))
([90d368d](ChromeDevTools@90d368d))


### 🛠️ Fixes

* disable NetworkManager in DevTools
([ChromeDevTools#1834](ChromeDevTools#1834))
([d0e6539](ChromeDevTools@d0e6539))
* do not use getSelectedMcpPage
([85f935b](ChromeDevTools@85f935b))
* improve geolocation emulation
([ChromeDevTools#2036](ChromeDevTools#2036))
([213720b](ChromeDevTools@213720b))
* report unknown tool arguments
([ChromeDevTools#2064](ChromeDevTools#2064))
([041b208](ChromeDevTools@041b208))
* respect user's npm registry configuration in update check
([ChromeDevTools#2038](ChromeDevTools#2038))
([83a299f](ChromeDevTools@83a299f))


### 📄 Documentation

* explain concurrent session options
([ChromeDevTools#2062](ChromeDevTools#2062))
([41944b3](ChromeDevTools@41944b3))
* fix typo
([ChromeDevTools#2075](ChromeDevTools#2075))
([1deb4f8](ChromeDevTools@1deb4f8))
* remove windows workaround and document Node LTS support
([ChromeDevTools#2074](ChromeDevTools#2074))
([30dcd0b](ChromeDevTools@30dcd0b))
* unhide various experimental flags
([ChromeDevTools#2055](ChromeDevTools#2055))
([081c903](ChromeDevTools@081c903))


### 🏗️ Refactor

* waitForResult helpers
([ChromeDevTools#2041](ChromeDevTools#2041))
([f6a12be](ChromeDevTools@f6a12be))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
OrKoN pushed a commit that referenced this pull request May 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.0.0](chrome-devtools-mcp-v0.26.0...chrome-devtools-mcp-v1.0.0)
(2026-05-18)


### 🎉 Features

* report new URL after actions that trigger navigation
([#1853](#1853))
([b594858](b594858))
* support filePath in evaluate_script
([#2054](#2054))
([90d368d](90d368d))


### 🛠️ Fixes

* disable NetworkManager in DevTools
([#1834](#1834))
([d0e6539](d0e6539))
* do not use getSelectedMcpPage
([85f935b](85f935b))
* improve geolocation emulation
([#2036](#2036))
([213720b](213720b))
* report unknown tool arguments
([#2064](#2064))
([041b208](041b208))
* respect user's npm registry configuration in update check
([#2038](#2038))
([83a299f](83a299f))


### 📄 Documentation

* explain concurrent session options
([#2062](#2062))
([41944b3](41944b3))
* fix typo
([#2075](#2075))
([1deb4f8](1deb4f8))
* remove windows workaround and document Node LTS support
([#2074](#2074))
([30dcd0b](30dcd0b))
* unhide various experimental flags
([#2055](#2055))
([081c903](081c903))


### 🏗️ Refactor

* waitForResult helpers
([#2041](#2041))
([f6a12be](f6a12be))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update error handling to help agents understand errors they make

3 participants