fix(codemod): keep request() result schemas the call still needs (#2383)

This commit is contained in:
Felix Weinberger 2026-06-29 15:00:39 +01:00 • committed by GitHub
commit 9f8ba61279
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,5 @@
---
'@modelcontextprotocol/codemod': patch
---
Keep the result-schema argument on `request()` calls unless the method is a literal spec method, and keep the generic passthrough `ResultSchema` even then. Schema-less v2 `request()` enforces the spec result schema for spec methods and throws a `TypeError` for non-spec methods, so dropping the schema from a dynamic-method call site (the proxy/forwarder shape, `request({ method, params }, ResultSchema)`) or from a custom-method call broke the call. `callTool()` is unaffected — v2 `callTool()` has no schema parameter.