Repository navigation
mcp: add param check for CompleteResult - #1080
Merged
Merged
Conversation
…n of CompleteParams fields
4 tasks done
nahapetyan-serob
approved these changes
Jul 13, 2026
guglielmo-san
enabled auto-merge (squash)
July 13, 2026 12:13
This was referenced Sep 25, 2026
guglielmo-san
pushed a commit
that referenced
this pull request
Sep 28, 2026
Fixes #1296. `Server.getPrompt` now returns `-32602` when an argument the prompt declares as required is missing from the request, before calling the handler. The spec asks for this (server/prompts, "Error Handling": missing required arguments, `-32602`, in 2025-11-25 and 2026-07-28), and it saves every handler from repeating the check. A required argument that is present but empty still reaches the handler, and a nil entry in `Prompt.Arguments` is skipped as before. The `AddPrompt` doc comment now says that `Required` is enforced. As #1080 did for `completion/complete`, `MCPGODEBUG=disablepromptargsvalidation=1` restores the old behavior. It is documented in the 1.9.0 section of `docs/mcpgodebug.md`; `go generate` updated it. `TestGetPromptRequiresDeclaredArguments` covers these cases: - a missing required argument, which fails without the change; - an empty required argument; - a missing optional argument; - a nil entry in `Prompt.Arguments`; - the MCPGODEBUG opt-out, set the way the other switches' tests set theirs. The conformance server suites give the same results as on main. On 2025-11-25 every scenario passes. On 2026-07-28 only the tasks scenarios fail, which this SDK does not implement yet.
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.
Fixes #1071