Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for parsing and converting string-encoded arguments passed by MCP clients into their declared parameter types (such as integers, floats, booleans, arrays, and maps) using JSON decoding. It updates the Argument.Parse method to handle this conversion, adds comprehensive unit tests covering various data types and edge cases, and integrates a new typed prompt test in the integration test suite. There are no review comments, and the implementation looks solid, so I have no feedback to provide.
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.
Description
Fixes #4432.
The prompt configuration supports every Parameter type, but MCP clients send
prompts/getvalues as strings. An integer argument such as{"count":"3"}currently fails parameter parsing instead of producing the prompt.Decode non-string prompt parameters from their JSON representation in the existing
Argumentwrapper, then use the existing parameter parser. This also preserves parameter-source selection, defaults and declared validation. Document the wire representation and cover the actual HTTP request path.Validation on Go 1.27.3:
-32602for the integer argument.go test -race ./internal/prompts/... -count=1andgo test ./tests/prompts/custom -run TestMCPPromptsIntegration -count=1 -timeout=10mpass.git diff --checkpass.go.modandgo.sumare unchanged.PR Checklist
!): not applicable.