Skip to content

fix: accept null tool call arguments#2139

Open
2830500285 wants to merge 2 commits into
modelcontextprotocol:mainfrom
2830500285:fix-tools-call-null-arguments
Open

fix: accept null tool call arguments#2139
2830500285 wants to merge 2 commits into
modelcontextprotocol:mainfrom
2830500285:fix-tools-call-null-arguments

Conversation

@2830500285
Copy link
Copy Markdown

Fixes #2012.

Summary

  • Accept null for tools/call arguments in the core request schema and normalize it to the same output as omitted arguments.
  • Add regression coverage for direct schema parsing and the high-level McpServer tools/call path.

Validation

  • Ran a targeted Zod runtime check for the updated schema expression: { arguments: null } parses successfully and normalizes to omitted, while non-record values still fail.
  • Attempted corepack pnpm install --frozen-lockfile and corepack pnpm install --frozen-lockfile --ignore-scripts; dependency linking did not complete in this Windows environment, so Vitest could not be run locally.

@2830500285 2830500285 requested a review from a team as a code owner May 21, 2026 11:32
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 21, 2026

🦋 Changeset detected

Latest commit: 86d827e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@modelcontextprotocol/core Patch
@modelcontextprotocol/server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 21, 2026

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2139

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2139

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2139

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2139

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2139

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2139

commit: 86d827e

@2830500285 2830500285 force-pushed the fix-tools-call-null-arguments branch from f9a8c26 to 86d827e Compare May 21, 2026 12:01
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.

tools/call with null arguments returns -32603 (InternalError) instead of being accepted

1 participant