mirror of
https://github.com/ChromeDevTools/chrome-devtools-mcp.git
synced 2026-11-04 15:00:11 +00:00
## Summary Moves JSON object parameter parsing and validation out of tool handlers into the Zod schemas using a shared `jsonObjectTransform` helper in `src/tools/ToolDefinition.ts`. - Adds `jsonObjectTransform` in `src/tools/ToolDefinition.ts` backed by `zod.record(zod.string(), zod.unknown())`. - Uses `.transform(zodTransform(jsonObjectTransform))` on `params` in `execute_3p_developer_tool` (`src/tools/thirdPartyDeveloper.ts`) and `input` in `execute_webmcp_tool` (`src/tools/webmcp.ts`), removing manual `JSON.parse` and plain-object checks from both handlers. ## User-visible behavior changes - Passing malformed JSON or non-object JSON (e.g. `[]`, `null`, primitives) to `execute_3p_developer_tool`'s `params` or `execute_webmcp_tool`'s `input` now fails at schema validation time (`Invalid arguments for tool ...`) before acquiring the page or running the handler.