Skip to content

fix: answer completion/complete without ref or argument with -32602 - #1279

Open
prathamgoyal787 wants to merge 1 commit into
modelcontextprotocol:mainfrom
prathamgoyal787:fix/completion-missing-ref-invalid-params
Open

prathamgoyal787 wants to merge 1 commit into
modelcontextprotocol:mainfrom
prathamgoyal787:fix/completion-missing-ref-invalid-params

Conversation

@prathamgoyal787

Copy link
Copy Markdown

CompleteRequest requires ref and argument, so a request missing either one failed to deserialize before the handler could check it. McpAsyncServer answered with -32603 Internal error, carrying the Jackson exception message. McpStatelessAsyncServer threw from handleRequest instead of returning a JSON-RPC error.

Both now answer with -32602 Invalid params, which is what CONTRIBUTING.md asks for when a dispatch identifier is missing.

Added CompletionRequestValidationTests. It fails on main (2 failures, 2 errors) and passes with this change.

CompleteRequest requires ref and argument, so a request missing either
failed to deserialize before the handler could check it. McpAsyncServer
answered it with -32603 Internal error, carrying the Jackson exception
message, and McpStatelessAsyncServer threw from handleRequest instead of
returning a JSON-RPC error. Answer both with -32602 Invalid params, as
CONTRIBUTING.md requires for a missing dispatch identifier.

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