Skip to content

Omit absent arguments from client tool calls - #762

Open
izbari wants to merge 1 commit into
modelcontextprotocol:mainfrom
izbari:fix/no-argument-tool-call
Open

izbari wants to merge 1 commit into
modelcontextprotocol:mainfrom
izbari:fix/no-argument-tool-call

Conversation

@izbari

@izbari izbari commented Dec 4, 2026

Copy link
Copy Markdown

Calling client.call_tool(name: "ping") against a no-argument tool on a TypeScript SDK 1.32.2 stdio server fails before the tool runs. The Ruby client serializes the default as "arguments": null. The TypeScript server rejects the request with Invalid input: expected record, received null at params.arguments.

Omit the optional member when the caller supplies no arguments. Explicit hashes, including an empty hash, still go on the wire. This matches the CallToolRequestParams schema.

The new regression test failed on main and passed with the fix. The same Ruby-to-TypeScript stdio call returned pong after the change. On Ruby 4.0.7 the full suite ran 2,903 tests with zero failures, zero errors and three skips. RuboCop passed, and the client and server conformance suites matched their expected-failure baselines on Node 22.

Implemented and verified with OpenAI Codex (GPT-6).

This branch has not been deployed

No deployments
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.

1 participant