Repository navigation
Conversation
## Motivation and Context modelcontextprotocol#691 answers `-32602` when the `arguments` of `tools/call` or `prompts/get` is not an object. The same kind of client mistake still surfaced as `-32603` Internal error, with a `TypeError` or `NoMethodError` handed to the exception reporter as if the server had failed, in these places: - `tools/call`, `prompts/get` and `logging/setLevel` with `params` that is an array, or absent. JSON-RPC allows positional params, so the request reaches the handler, which reads a named member. - `completion/complete` with a `ref` or an `argument` that is not an object. All of them are now refused with `-32602` Invalid params before the handler, the tool or the prompt runs, as `resources/read` and `resources/subscribe` already are. An absent or `null` `arguments` still stands for none. Resolves modelcontextprotocol#694. The issue also asks that such a refusal stay out of the exception reporter. That is not taken: the SDK reports a request its handlers refuse, an unknown tool as much as these, and what the reporter receives is now a `RequestHandlerError` whose `error_type` is `:invalid_params`, in place of the `TypeError` or `NoMethodError`. ## How Has This Been Tested? `test/mcp/server_test.rb`; two of the three new tests fail on the previous library, and the third holds that absent and `null` arguments keep working. ## Breaking Changes None for a request that follows the schema.
koic
force-pushed
the
answer_invalid_params_for_the_remaining_malformed_params
branch
from
November 21, 2026 18:31
676c263 to
afb3e3e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
#691 answers
-32602when theargumentsoftools/callorprompts/getis not an object. The same kind of client mistake still surfaced as-32603Internal error, with aTypeErrororNoMethodErrorhanded to the exception reporter as if the server had failed, in these places:tools/call,prompts/getandlogging/setLevelwithparamsthat is an array, or absent. JSON-RPC allows positional params, so the request reaches the handler, which reads a named member.completion/completewith arefor anargumentthat is not an object.All of them are now refused with
-32602Invalid params before the handler, the tool or the prompt runs, asresources/readandresources/subscribealready are. An absent ornullargumentsstill stands for none.Resolves #694.
The issue also asks that such a refusal stay out of the exception reporter. That is not taken: the SDK reports a request its handlers refuse, an unknown tool as much as these, and what the reporter receives is now a
RequestHandlerErrorwhoseerror_typeis:invalid_params, in place of theTypeErrororNoMethodError.How Has This Been Tested?
test/mcp/server_test.rb; two of the three new tests fail on the previous library, and the third holds that absent andnullarguments keep working.Breaking Changes
None for a request that follows the schema.
Types of changes
Checklist